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

Unified Diff: tests/lib/mirrors/redirection_type_shuffling_test.dart

Issue 25097005: Make ClassMirror.newInstance deal with reordered etc type arguments for redirecting factories. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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/lib/mirrors/redirecting_factory_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/redirection_type_shuffling_test.dart
diff --git a/tests/lib/mirrors/redirection_type_shuffling_test.dart b/tests/lib/mirrors/redirection_type_shuffling_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..6b25da089548ca021eb78d191347f16a5f6c3455
--- /dev/null
+++ b/tests/lib/mirrors/redirection_type_shuffling_test.dart
@@ -0,0 +1,20 @@
+// Copyright (c) 2013, 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.
+
+import "dart:mirrors";
+import "package:expect/expect.dart";
+
+class G<A extends int, B extends String> {
+ G();
+ factory G.swap() = G<B,A>;
+ factory G.retain() = G<A,B>;
+}
+
+main() {
+ ClassMirror cm = reflect(new G<int, String>()).type;
+
+ cm.newInstance(#swap, []); /// 01: dynamic type error
+
+ Expect.isTrue(cm.newInstance(#retain, []).reflectee is G<int,String>);
+}
« no previous file with comments | « tests/lib/mirrors/redirecting_factory_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698