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

Unified Diff: tests/language/deferred_constraints_test.dart

Issue 183743031: Introduce constraints of deferred constants. (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
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/warnings.dart ('k') | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/deferred_constraints_test.dart
diff --git a/tests/language/deferred_constraints_test.dart b/tests/language/deferred_constraints_test.dart
index 9ac8d4de029f8fd11903de19cb24750f76609c09..6e510735fa8ff114ffa040ac0918584aabcaffa9 100644
--- a/tests/language/deferred_constraints_test.dart
+++ b/tests/language/deferred_constraints_test.dart
@@ -13,6 +13,10 @@ 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
@@ -44,6 +48,10 @@ 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
});
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/warnings.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698