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

Unified Diff: tests/language/src/PseudoKWTest.dart

Issue 9107070: Proper handling of built-in identifiers (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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
« tests/language/src/NamingTest.dart ('K') | « tests/language/src/NamingTest.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/src/PseudoKWTest.dart
===================================================================
--- tests/language/src/PseudoKWTest.dart (revision 3272)
+++ tests/language/src/PseudoKWTest.dart (working copy)
@@ -49,7 +49,52 @@
}
}
+typedef(x) => "typedef " + x;
+static(abstract) {
+ return abstract == true;
+}
+
+class A {
+ var typedef = 0;
+ set(x) { typedef = x; }
+ get() => typedef - 5;
+
+ static static() {
+ return 1;
+ }
+ static check() {
+ var o = new A();
+ o.set(55);
+ Expect.equals(50, o.get());
+ static();
+ }
+}
+
+class B {
+ var abstract;
+ get get() => abstract;
+ set get(x) => abstract = 2 * x;
siva 2012/01/13 18:48:20 set get(B get) => abstract = 2 * get.get?
hausner 2012/01/13 19:22:47 Nice :) I made it even more pathological and promp
+
+ static() {
+ var o = new B();
+ o.get = 100;
+ Expect.equals(200, o.get);
+ }
+ int operator() {
+ return 1;
+ }
+}
+
+
main() {
PseudoKWTest.testMain();
+ A.check();
+ new B().static();
+ Expect.equals(1, new B().operator());
+ Expect.equals(1, A.static());
+ typedef("T");
+ Expect.equals("typedef T", typedef("T"));
+ static("true");
+ Expect.equals(false, static("true"));
}
« tests/language/src/NamingTest.dart ('K') | « tests/language/src/NamingTest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698