| 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 import 'generics_helper.dart'; | 10 import 'generics_helper.dart'; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 typeParameters(reflect(new D()).type, []); | 72 typeParameters(reflect(new D()).type, []); |
| 73 typeParameters(reflect(new E()).type, [#S]); | 73 typeParameters(reflect(new E()).type, [#S]); |
| 74 typeParameters(reflect(new F<num>()).type, [#R]); | 74 typeParameters(reflect(new F<num>()).type, [#R]); |
| 75 typeParameters(reflect(new G()).type, []); | 75 typeParameters(reflect(new G()).type, []); |
| 76 typeParameters(reflect(new H()).type, [#A, #B, #C]); | 76 typeParameters(reflect(new H()).type, [#A, #B, #C]); |
| 77 typeParameters(reflect(new I()).type, []); | 77 typeParameters(reflect(new I()).type, []); |
| 78 | 78 |
| 79 var numMirror = reflectClass(num); | 79 var numMirror = reflectClass(num); |
| 80 var dynamicMirror = currentMirrorSystem().dynamicType; | 80 var dynamicMirror = currentMirrorSystem().dynamicType; |
| 81 typeArguments(reflect(new A<num>()).type, [numMirror]); | 81 typeArguments(reflect(new A<num>()).type, [numMirror]); |
| 82 typeArguments(reflect(new A<dynamic>()).type, [dynamicMirror]); /// 01: ok | 82 typeArguments(reflect(new A<dynamic>()).type, [dynamicMirror]); |
| 83 typeArguments(reflect(new A()).type, [dynamicMirror]); /// 01: ok | 83 typeArguments(reflect(new A()).type, [dynamicMirror]); /// 01: ok |
| 84 typeArguments(reflect(new B()).type, []); | 84 typeArguments(reflect(new B()).type, []); |
| 85 typeArguments(reflect(new C()).type, []); | 85 typeArguments(reflect(new C()).type, []); |
| 86 typeArguments(reflect(new D()).type, []); | 86 typeArguments(reflect(new D()).type, []); |
| 87 typeArguments(reflect(new E<num>()).type, [numMirror]); | 87 typeArguments(reflect(new E<num>()).type, [numMirror]); |
| 88 typeArguments(reflect(new E<dynamic>()).type, [dynamicMirror]); /// 01: ok | 88 typeArguments(reflect(new E<dynamic>()).type, [dynamicMirror]); /// 01: ok |
| 89 typeArguments(reflect(new E()).type, [dynamicMirror]); /// 01: ok | 89 typeArguments(reflect(new E()).type, [dynamicMirror]); /// 01: ok |
| 90 typeArguments(reflect(new F<num>()).type, [numMirror]); | 90 typeArguments(reflect(new F<num>()).type, [numMirror]); |
| 91 typeArguments(reflect(new F<dynamic>()).type, [dynamicMirror]); /// 01: ok | 91 typeArguments(reflect(new F<dynamic>()).type, [dynamicMirror]); /// 01: ok |
| 92 typeArguments(reflect(new F()).type, [dynamicMirror]); /// 01: ok | 92 typeArguments(reflect(new F()).type, [dynamicMirror]); /// 01: ok |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 }); | 153 }); |
| 154 }); | 154 }); |
| 155 | 155 |
| 156 Expect.equals(reflectClass(A).typeVariables[0].owner, reflectClass(A)); | 156 Expect.equals(reflectClass(A).typeVariables[0].owner, reflectClass(A)); |
| 157 Expect.equals(reflectClass(Z).typeVariables[0].owner, reflectClass(Z)); | 157 Expect.equals(reflectClass(Z).typeVariables[0].owner, reflectClass(Z)); |
| 158 Expect.notEquals(reflectClass(A).typeVariables[0], | 158 Expect.notEquals(reflectClass(A).typeVariables[0], |
| 159 reflectClass(Z).typeVariables[0]); | 159 reflectClass(Z).typeVariables[0]); |
| 160 Expect.equals(reflectClass(A).typeVariables[0], | 160 Expect.equals(reflectClass(A).typeVariables[0], |
| 161 reflectClass(A).typeVariables[0]); | 161 reflectClass(A).typeVariables[0]); |
| 162 } | 162 } |
| OLD | NEW |