OLD | NEW |
(Empty) | |
| 1 library lib; |
| 2 |
| 3 import "deferred_mirrors_metadata_test.dart"; |
| 4 @MirrorsUsed( |
| 5 targets: const ["main", "main.A", "main.B", "main.C", "main.D", "lib.E"]) |
| 6 import "dart:mirrors"; |
| 7 |
| 8 class H { |
| 9 const H(); |
| 10 } |
| 11 |
| 12 class F { |
| 13 @H() final int f; |
| 14 } |
| 15 |
| 16 @C() class E { |
| 17 @D() var f; |
| 18 } |
| 19 |
| 20 String foo() { |
| 21 String c = reflectClass(E).metadata[0].invoke(#toString, []).reflectee; |
| 22 String d = reflectClass(E).declarations[#f].metadata[0] |
| 23 .invoke(#toString, []).reflectee; |
| 24 InstanceMirror i = currentMirrorSystem().findLibrary(#main).metadata[0]; |
| 25 String a = i.invoke(#toString, []).reflectee; |
| 26 String b = i.getField(#b).invoke(#toString, []).reflectee; |
| 27 return a + b + c + d; |
| 28 } |
| 29 |
OLD | NEW |