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

Unified Diff: tests/language/class_literal_test.dart

Issue 18801007: Support type parameters and classes as expression in the vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 | « tests/co19/co19-runtime.status ('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/class_literal_test.dart
===================================================================
--- tests/language/class_literal_test.dart (revision 24832)
+++ tests/language/class_literal_test.dart (working copy)
@@ -13,24 +13,6 @@
foo(x) {}
main() {
- if (false) {
- Class(); /// 02: compile-time error
- Class[0]; /// 05: compile-time error
- var x = Class(); /// 07: compile-time error
- var x = Class[0]; /// 10: compile-time error
- var x = Class[0].field; /// 11: compile-time error
- var x = Class[0].method(); /// 12: compile-time error
- foo(Class()); /// 14: compile-time error
- foo(Class[0]); /// 17: compile-time error
- foo(Class[0].field); /// 18: compile-time error
- foo(Class[0].method()); /// 19: compile-time error
- Class[0] = 91; /// 22: compile-time error
- Class++; /// 23: compile-time error
- ++Class; /// 24: compile-time error
- Class[0] += 3; /// 27: compile-time error
- ++Class[0]; /// 28: compile-time error
- Class[0]++; /// 29: compile-time error
- }
Expect.equals(42, Class.fisk());
Expect.equals(null, foo(Class.fisk()));
@@ -41,6 +23,22 @@
Expect.isFalse(Class == null);
// Verify that dereferencing a class literal is a runtime error.
+ Expect.throws(() { Class(); }, (e) => e is NoSuchMethodError);
+ Expect.throws(() { Class[0]; }, (e) => e is NoSuchMethodError);
+ Expect.throws(() { var x = Class(); }, (e) => e is NoSuchMethodError);
+ Expect.throws(() { var x = Class[0]; }, (e) => e is NoSuchMethodError);
+ Expect.throws(() { var x = Class[0].field; }, (e) => e is NoSuchMethodError);
+ Expect.throws(() { var x = Class[0].method(); }, (e) => e is NoSuchMethodError);
+ Expect.throws(() { foo(Class()); }, (e) => e is NoSuchMethodError);
+ Expect.throws(() { foo(Class[0]); }, (e) => e is NoSuchMethodError);
+ Expect.throws(() { foo(Class[0].field); }, (e) => e is NoSuchMethodError);
+ Expect.throws(() { foo(Class[0].method()); }, (e) => e is NoSuchMethodError);
+ Expect.throws(() { Class[0] = 91; }, (e) => e is NoSuchMethodError);
+ Expect.throws(() { Class++; }, (e) => e is NoSuchMethodError);
+ Expect.throws(() { ++Class; }, (e) => e is NoSuchMethodError);
+ Expect.throws(() { Class[0] += 3; }, (e) => e is NoSuchMethodError);
+ Expect.throws(() { ++Class[0]; }, (e) => e is NoSuchMethodError);
+ Expect.throws(() { Class[0]++; }, (e) => e is NoSuchMethodError);
Expect.throws(() { Class.method(); }, (e) => e is NoSuchMethodError);
Expect.throws(() { Class.field; }, (e) => e is NoSuchMethodError);
Expect.throws(() { var x = Class.method(); }, (e) => e is NoSuchMethodError);
« no previous file with comments | « tests/co19/co19-runtime.status ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698