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

Unified Diff: tests/language/first_class_types_literals_test.dart

Issue 23825007: Reapply r27285: "Support dynamic as type literal." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Try to resolve dynamic in scope before testing for the name. Created 7 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/first_class_types_literals_test.dart
diff --git a/tests/language/first_class_types_literals_test.dart b/tests/language/first_class_types_literals_test.dart
index 896ba5d62f1f96f45926d5eaef4065fc42519504..8ba570a6baac87597a6ca6e526606756a679c734 100644
--- a/tests/language/first_class_types_literals_test.dart
+++ b/tests/language/first_class_types_literals_test.dart
@@ -19,9 +19,11 @@ main() {
Expect.equals(int, int);
Expect.notEquals(int, num);
Expect.equals(Foo, Foo);
+ Expect.equals(dynamic, dynamic);
// Test that class literals return instances of Type.
Expect.isTrue((D).runtimeType is Type);
+ Expect.isTrue((dynamic).runtimeType is Type);
// Test that types from runtimeType and literals agree.
Expect.equals(int, 1.runtimeType);
@@ -40,4 +42,11 @@ main() {
Expect.throws(() => C + 1, (e) => e is NoSuchMethodError);
Expect.throws(() => C[2], (e) => e is NoSuchMethodError);
Expect.throws(() => C[2] = 'hest', (e) => e is NoSuchMethodError);
+ Expect.throws(() => dynamic = 1, (e) => e is NoSuchMethodError);
+ Expect.throws(() => dynamic++, (e) => e is NoSuchMethodError);
+ Expect.throws(() => dynamic + 1, (e) => e is NoSuchMethodError);
+ Expect.throws(() => dynamic[2], (e) => e is NoSuchMethodError);
+ Expect.throws(() => dynamic[2] = 'hest', (e) => e is NoSuchMethodError);
+
+ Expect.equals((dynamic).toString(), 'dynamic');
}

Powered by Google App Engine
This is Rietveld 408576698