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

Unified Diff: tests/language/regress_23408_test.dart

Issue 1219023002: Redirection type of a redirecting factory can be deferred (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add test case Created 5 years, 6 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/regress_23408_lib.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/regress_23408_test.dart
diff --git a/tests/language/regress_23408_test.dart b/tests/language/regress_23408_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f47f1cb950343236f6b89493dab8da168a526366
--- /dev/null
+++ b/tests/language/regress_23408_test.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// 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 regress_23408_test;
+
+import 'package:expect/expect.dart';
+
+import 'regress_23408_lib.dart' deferred as lib;
+
+class A<T> extends C {
+ get t => "$T";
+}
+
+class C {
+ var v = 55;
+ C();
+ factory C.c() = lib.K;
+ factory C.l() = A<lib.K>;
+}
+
+void main() {
+ var a = new C.l(); // Redirects to A<dynamic>
+ Expect.equals("dynamic", a.t);
+ Expect.throws(() => new C.c());
+ lib.loadLibrary().then((_) {
+ var b = new C.l(); // Still redirects to A<dynamic>
+ Expect.equals("dynamic", b.t);
+ var z = new C.c();
+ Expect.equals(55, z.v);
+ });
+}
« no previous file with comments | « tests/language/regress_23408_lib.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698