Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Unified Diff: tests/language/redirecting_factory_reflection_test.dart

Issue 1227873004: dart2js cps: Implement compilation of redirecting factory constructors for reflection. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Address comment. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/language/language_dart2js.status ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/redirecting_factory_reflection_test.dart
diff --git a/tests/lib/mirrors/typedef_library_test.dart b/tests/language/redirecting_factory_reflection_test.dart
similarity index 50%
copy from tests/lib/mirrors/typedef_library_test.dart
copy to tests/language/redirecting_factory_reflection_test.dart
index 6549797a49a0fe338b8a0acb0c5d643ef49a896e..af39373979bc72406783fa62c47056de3f644f42 100644
--- a/tests/lib/mirrors/typedef_library_test.dart
+++ b/tests/language/redirecting_factory_reflection_test.dart
@@ -2,16 +2,21 @@
// 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.
-library foo;
-
-@MirrorsUsed(targets: const ["foo", "bar"])
import 'dart:mirrors';
-import 'typedef_library.dart';
-
import 'package:expect/expect.dart';
+abstract class A<T> {
+ get t;
+ factory A() = B<T, A<T>>;
+}
+
+class B<X, Y> implements A<X> {
+ final t;
+ B() : t = Y;
+}
+
main() {
- var barLibrary = currentMirrorSystem().findLibrary(new Symbol("bar"));
- var gTypedef = barLibrary.declarations[new Symbol("G")];
- Expect.equals("G", MirrorSystem.getName(gTypedef.simpleName));
+ ClassMirror m = reflectClass(A);
+ var i = m.newInstance(const Symbol(''), []).reflectee;
+ Expect.equals(i.t.toString(), 'A');
}
« no previous file with comments | « tests/language/language_dart2js.status ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698