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 lib; | 5 library lib; |
6 | 6 |
7 @MirrorsUsed(targets: "lib") | 7 @MirrorsUsed(targets: "lib") |
8 import "dart:mirrors"; | 8 import "dart:mirrors"; |
9 | 9 |
10 import "package:expect/expect.dart"; | 10 import "package:expect/expect.dart"; |
(...skipping 26 matching lines...) Expand all Loading... |
37 Expect.equals(true, mm.returnType is TypeMirror); | 37 Expect.equals(true, mm.returnType is TypeMirror); |
38 Expect.equals(#dynamic, mm.returnType.simpleName); | 38 Expect.equals(#dynamic, mm.returnType.simpleName); |
39 | 39 |
40 mm = (reflect(voidFunc) as ClosureMirror).function; | 40 mm = (reflect(voidFunc) as ClosureMirror).function; |
41 Expect.equals(true, mm.returnType is TypeMirror); | 41 Expect.equals(true, mm.returnType is TypeMirror); |
42 Expect.equals(const Symbol("void"), mm.returnType.simpleName); | 42 Expect.equals(const Symbol("void"), mm.returnType.simpleName); |
43 | 43 |
44 ClassMirror cm = reflectClass(C); | 44 ClassMirror cm = reflectClass(C); |
45 mm = cm.declarations[#getE]; | 45 mm = cm.declarations[#getE]; |
46 Expect.equals(true, mm.returnType is TypeMirror); | 46 Expect.equals(true, mm.returnType is TypeMirror); |
47 // The spec for this is ambigious and needs to be updated before it is clear | 47 // The spec for this is ambiguous and needs to be updated before it is clear |
48 // what has to be returned. | 48 // what has to be returned. |
49 //Expect.equals("E", _n(mm.returnType.simpleName)); | 49 //Expect.equals("E", _n(mm.returnType.simpleName)); |
50 Expect.equals(true, mm.owner is ClassMirror); | 50 Expect.equals(true, mm.owner is ClassMirror); |
51 Expect.equals(#C, mm.owner.simpleName); | 51 Expect.equals(#C, mm.owner.simpleName); |
52 } | 52 } |
OLD | NEW |