Index: tests/lib/mirrors/metadata_const_map_test.dart |
diff --git a/tests/compiler/dart2js_extra/closure_type_reflection2_test.dart b/tests/lib/mirrors/metadata_const_map_test.dart |
similarity index 51% |
copy from tests/compiler/dart2js_extra/closure_type_reflection2_test.dart |
copy to tests/lib/mirrors/metadata_const_map_test.dart |
index ef97222c9cf6f7a9174e9611cec9e8470f93b247..4ed50ddb3f2740be12e36a1479cddb1aefa87087 100644 |
--- a/tests/compiler/dart2js_extra/closure_type_reflection2_test.dart |
+++ b/tests/lib/mirrors/metadata_const_map_test.dart |
@@ -2,21 +2,23 @@ |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
-// Test that classes referenced from a signature of a tear-off closure |
-// are emitted. |
+// Regression test for issue 20776. Tests that the needed classes for the |
+// constant map in the metadata are generated. |
-@MirrorsUsed(targets: 'C') |
+library lib; |
+ |
+@MirrorsUsed(targets: 'lib') |
import 'dart:mirrors'; |
-import 'package:expect/expect.dart'; |
+class C { |
+ final x; |
+ const C(this.x); |
+} |
+@C(const {'foo': 'bar' }) |
class A {} |
-class C { |
- A foo() {} |
-} |
main() { |
- Expect.isFalse(reflect(new C().foo).function.returnType.toString() |
- .contains('dynamic')); |
-} |
+ print(reflectClass(A).metadata); |
+} |