| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Check that cyclic reference of a typedef is a compile-time error. | 5 // Check that cyclic reference of a typedef is a compile-time error. |
| 6 | 6 |
| 7 // To test various cyclic references the definition of the [:typedef A():] is | 7 // To test various cyclic references the definition of the [:typedef A():] is |
| 8 // split over several lines: | 8 // split over several lines: |
| 9 typedef | 9 typedef |
| 10 | 10 |
| 11 // Cyclic through return type. | 11 // Cyclic through return type. |
| 12 A //# 01: compile-time error | 12 A //# 01: compile-time error |
| 13 | 13 |
| 14 A // The name of the typedef | 14 A // The name of the typedef |
| 15 | 15 |
| 16 // Cyclic through type variable bound. | 16 // Cyclic through type variable bound. |
| 17 <T extends A> //# 10: compile-time error | 17 <T extends A> //# 10: compile-time error |
| 18 | 18 |
| 19 // Cyclic through generic type variable bound. | 19 // Cyclic through generic type variable bound. |
| 20 <T extends List<A>> //# 11: compile-time error | 20 <T extends List<A>> //# 11: compile-time error |
| 21 | 21 |
| 22 ( // The left parenthesis of the typedef arguments. | 22 (// The left parenthesis of the typedef arguments. |
| 23 | 23 |
| 24 // Cyclic through parameter type. | 24 // Cyclic through parameter type. |
| 25 A a //# 02: compile-time error | 25 A a //# 02: compile-time error |
| 26 | 26 |
| 27 // Cyclic through optional parameter type. | 27 // Cyclic through optional parameter type. |
| 28 [A a] //# 03: compile-time error | 28 [A a] //# 03: compile-time error |
| 29 | 29 |
| 30 // Cyclic through named parameter type. | 30 // Cyclic through named parameter type. |
| 31 {A a} //# 04: compile-time error | 31 {A a} //# 04: compile-time error |
| 32 | 32 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 44 | 44 |
| 45 // Cyclic through another more typedefs. | 45 // Cyclic through another more typedefs. |
| 46 C c //# 09: compile-time error | 46 C c //# 09: compile-time error |
| 47 | 47 |
| 48 // Reference through a class is not a cyclic self-reference. | 48 // Reference through a class is not a cyclic self-reference. |
| 49 Class c //# 12: ok | 49 Class c //# 12: ok |
| 50 | 50 |
| 51 // Reference through a class type bound is not a cyclic self-reference. | 51 // Reference through a class type bound is not a cyclic self-reference. |
| 52 Class c //# 13: ok | 52 Class c //# 13: ok |
| 53 | 53 |
| 54 ); // The right parenthesis of the typedef arguments. | 54 ); // The right parenthesis of the typedef arguments. |
| 55 | 55 |
| 56 typedef B(A a); | 56 typedef B(A a); |
| 57 typedef C(B b); | 57 typedef C(B b); |
| 58 | 58 |
| 59 class Class | 59 class Class |
| 60 <T extends A> //# 13: continued | 60 <T extends A> //# 13: continued |
| 61 { | 61 { |
| 62 A a; //# 12: continued | 62 A a; //# 12: continued |
| 63 } | 63 } |
| 64 | 64 |
| 65 void testA(A a) {} | 65 void testA(A a) {} |
| 66 | 66 |
| 67 void main() { | 67 void main() { |
| 68 testA(null); | 68 testA(null); |
| 69 } | 69 } |
| OLD | NEW |