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

Unified Diff: tests/language/deferred_constraints_type_annotation_test.dart

Issue 195983006: Constrain constant references from deferred libraries (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/deferred_constraints_type_annotation_test.dart
diff --git a/tests/language/deferred_constraints_test.dart b/tests/language/deferred_constraints_type_annotation_test.dart
similarity index 77%
rename from tests/language/deferred_constraints_test.dart
rename to tests/language/deferred_constraints_type_annotation_test.dart
index 6992b78892bfb6ee86f7ad4411d95cb3eb6d06a3..cd4cdf542568753680412935f12ec4c7c00e6e3a 100644
--- a/tests/language/deferred_constraints_test.dart
+++ b/tests/language/deferred_constraints_type_annotation_test.dart
@@ -14,21 +14,17 @@ const lazy = const DeferredLibrary('lib');
class F {}
class G2<T> {}
-void f({a: const lib.Const()}) {} /// const_default_argument: compile-time error
-
-@lib.Const() class H {} /// const_annotation: compile-time error
-
-void main() {
- Expect.throws(() { /// type_annotation1: static type warning
- lib.C a = new lib.C(); /// type_annotation1: continued
- }, (e) => e is NoSuchMethodError); /// type_annotation1: continued
+main() {
lib.C a = null; /// type_annotation_null: static type warning
+ Expect.throws(() { /// new_before_load: static type warning
+ lib.C a = new lib.C(); /// new_before_load: continued
+ }, (e) => e is NoSuchMethodError); /// new_before_load: continued
// In this case we do not defer C.
lib2.C a1 = new lib2.C(); /// type_annotation_non_deferred: continued
asyncStart();
lazy.load().then((_) {
- lib.C a2 = new lib.C(); /// type_annotation2: dynamic type error, static type warning
+ lib.C a2 = new lib.C(); /// type_annotation1: dynamic type error, static type warning
lib.G<F> a3 = new lib.G<F>(); /// type_annotation_generic1: dynamic type error, static type warning
G2<lib.C> a4 = new G2(); /// type_annotation_generic2: static type warning
G2<lib.C> a5 = new G2<lib.C>(); /// type_annotation_generic3: static type warning
@@ -50,10 +46,6 @@ void main() {
try { throw instance; } on lib.Const {} /// catch_check: continued
}, (e) => e is TypeError); /// catch_check: continued
int i = lib.C.staticMethod(); /// static_method: ok
- var c1 = const lib.Const(); /// const: compile-time error
- f(); /// const_default_argument: continued
- var constInstance = lib.constantInstance; /// const_instance: ok
- var h = new H(); /// const_annotation: continued
asyncEnd();
});
}

Powered by Google App Engine
This is Rietveld 408576698