| 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 library test.type_arguments_test; | 5 library test.type_arguments_test; |
| 6 | 6 |
| 7 import 'dart:mirrors'; | 7 import 'dart:mirrors'; |
| 8 | 8 |
| 9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
| 10 | 10 |
| 11 class A<T> {} | 11 class A<T> {} |
| 12 class B extends A {} // Same as class B extends A<dynamic>. | 12 class B extends A {} // Same as class B extends A<dynamic>. |
| 13 class C extends A<num, int> {} // Same as class C extends A<dynamic>. | 13 class C extends A |
| 14 <num, int> // TODO(zarah): Should be "01: static warning". |
| 15 {} // Same as class C extends A<dynamic>. |
| 14 class D extends A<int> {} | 16 class D extends A<int> {} |
| 15 class E<S> extends A<S> {} | 17 class E<S> extends A<S> {} |
| 16 class F<R> extends A<int> {} | 18 class F<R> extends A<int> {} |
| 17 class G {} | 19 class G {} |
| 18 class H<A,B,C> {} | 20 class H<A,B,C> {} |
| 19 | 21 |
| 20 typeParameters(mirror, parameterNames) { | 22 typeParameters(mirror, parameterNames) { |
| 21 Expect.listEquals(parameterNames.map((n) => new Symbol(n)).toList(), | 23 Expect.listEquals(parameterNames.map((n) => new Symbol(n)).toList(), |
| 22 mirror.typeVariables.map((v) => v.simpleName).toList()); | 24 mirror.typeVariables.map((v) => v.simpleName).toList()); |
| 23 } | 25 } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 currentMirrorSystem().libraries.values.forEach((libraryMirror) { | 137 currentMirrorSystem().libraries.values.forEach((libraryMirror) { |
| 136 libraryMirror.classes.values.forEach((classMirror) { | 138 libraryMirror.classes.values.forEach((classMirror) { |
| 137 // TODO(12282): Deal with generic typedefs. | 139 // TODO(12282): Deal with generic typedefs. |
| 138 if (classMirror is! TypedefMirror) { | 140 if (classMirror is! TypedefMirror) { |
| 139 Expect.isTrue(classMirror.isOriginalDeclaration); | 141 Expect.isTrue(classMirror.isOriginalDeclaration); |
| 140 Expect.equals(classMirror, classMirror.originalDeclaration); | 142 Expect.equals(classMirror, classMirror.originalDeclaration); |
| 141 } | 143 } |
| 142 }); | 144 }); |
| 143 }); | 145 }); |
| 144 } | 146 } |
| OLD | NEW |