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

Unified Diff: tests/compiler/dart2js_extra/typevariable_factory_test.dart

Issue 12261006: Share addTypeVariableReference between factory calls and is-checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rename the second test. Created 7 years, 10 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
Index: tests/compiler/dart2js_extra/typevariable_factory_test.dart
diff --git a/tests/language/private_selector_lib.dart b/tests/compiler/dart2js_extra/typevariable_factory_test.dart
similarity index 52%
copy from tests/language/private_selector_lib.dart
copy to tests/compiler/dart2js_extra/typevariable_factory_test.dart
index c9a11c9b34ac40a3d631ffec1f16b497757e62f8..5618cae2caea06d6ff4245fa7c76c1a2fae34f82 100644
--- a/tests/language/private_selector_lib.dart
+++ b/tests/compiler/dart2js_extra/typevariable_factory_test.dart
@@ -2,18 +2,14 @@
// 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 private_selector_lib;
+// Regression test to ensure that we can use type variable in factories.
-import 'private_selector_test.dart';
-
-bool executed = false;
-
-class A {
- public() {
- new B()._private();
- }
-
- _private() {
- executed = true;
+class A<T> {
+ factory A.foo(o) {
+ Expect.isTrue(o is A<T>);
+ return new A();
}
+ A();
}
+
+main() => new A<int>.foo(new A<int>());

Powered by Google App Engine
This is Rietveld 408576698