| 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());
|
| +}
|
|
|