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

Unified Diff: dart/tests/language/abstract_getter_test.dart

Issue 10880040: Support abstract getters without parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update language.status Created 8 years, 4 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: dart/tests/language/abstract_getter_test.dart
diff --git a/dart/tests/language/abstract_getter_test.dart b/dart/tests/language/abstract_getter_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..0f4d3dbab21492e45b1898e3ac8c144d0369b45d
--- /dev/null
+++ b/dart/tests/language/abstract_getter_test.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Test to ensure that an abstract getter is not mistaken for a field.
+
+class Foo {
+ abstract get i;
+}
+
+class Bar {
+}
+
+noMethod(e) => e is NoSuchMethodException;
+
+checkIt(f) {
+ Expect.throws(() { f.i = 'hi'; }, noMethod);
+ Expect.throws(() { print(f.i); }, noMethod);
+ Expect.throws(() { print(f.i()); }, noMethod);
+}
+
+main() {
+ checkIt(new Foo());
+ checkIt(new Bar());
+}
« no previous file with comments | « dart/tests/compiler/dart2js_foreign/native_property_test.dart ('k') | dart/tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698