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

Unified Diff: tests/language/type_variables_static_scoping_test.dart

Issue 10996039: Bring type variables into static scope, but produce compile-time error when they are used. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed passing test from the exception list. Created 8 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
Index: tests/language/type_variables_static_scoping_test.dart
diff --git a/tests/language/type_variables_static_scoping_test.dart b/tests/language/type_variables_static_scoping_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5099857baa21fef7a4f2907933511d2466f27ba3
--- /dev/null
+++ b/tests/language/type_variables_static_scoping_test.dart
@@ -0,0 +1,20 @@
+class Foo<T> {
+ T t;
+ static T x; /// 01: compile-time error
+ static foo1() => new Foo<T>(); /// 02: compile-time error
+ Foo();
+ Foo.dup(T);
+ static void foo1(T x) => null; /// 03: compile-time error
+ static void foo2() => new Foo<T>(); /// 04: compile-time error
+ static T foo3() => null; /// 05: compile-time error
+}
+
+main() {
+ new Foo<int>().t = 1;
ngeoffray 2012/10/02 07:53:46 too many indentation
aam-me 2012/10/02 12:50:39 Done.
+ Foo.x = 1; /// 01: continued
+ Foo.foo1(); /// 02: continued
+ new Foo<int>.dup(1);
+ Foo.foo1(1); /// 03: continued
+ Foo.foo2(); /// 04: continued
+ Foo.foo3(); /// 05: continued
+}
« lib/compiler/implementation/resolver.dart ('K') | « tests/co19/co19-dart2js.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698