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

Unified Diff: tests/language/type_parameter_test.dart

Issue 11030056: Implement new scope rules for type variables (issue 5230). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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_parameter_test.dart
===================================================================
--- tests/language/type_parameter_test.dart (revision 13309)
+++ tests/language/type_parameter_test.dart (working copy)
@@ -21,13 +21,24 @@
a) {
final
T /// 03: static type warning, dynamic type error
- a = null;
+ a = "not_null";
print(a);
+ return a;
}
static final
T /// 04: static type warning, dynamic type error
- staticField = null;
+ staticField = "not_null";
+
+ // Assigning null to a malformed type is not a dynamic error.
+ static
+ T staticMethod2(T a) {
+ final T a = null;
+ print(a);
+ return a;
+ }
+
+ static final T staticField2 = null;
}
main() {
@@ -45,6 +56,9 @@
Expect.isTrue(s is Set<int>);
Expect.isFalse(s is Set<double>);
- A.staticMethod(null);
+ A.staticMethod("not_null");
print(A.staticField);
+
+ A.staticMethod2(null);
+ print(A.staticField2);
}

Powered by Google App Engine
This is Rietveld 408576698