| Index: tests/language/cast2_test.dart
|
| diff --git a/tests/language/cast2_test.dart b/tests/language/cast2_test.dart
|
| index 397ac4543ff4c3490b61688db66ebe655ef4aa8f..b2aa11f6d8cff760b62c8b611965751d022feba8 100644
|
| --- a/tests/language/cast2_test.dart
|
| +++ b/tests/language/cast2_test.dart
|
| @@ -3,10 +3,15 @@
|
| // BSD-style license that can be found in the LICENSE file.
|
| // Dart test program for constructors and initializers.
|
|
|
| +import "package:expect/expect.dart";
|
| +
|
| // Test 'expression as Type' casts.
|
|
|
| class C {
|
| final int foo = 42;
|
| +
|
| + int val = 0;
|
| + void inc() { ++val; }
|
| }
|
|
|
| class D extends C {
|
| @@ -18,6 +23,10 @@ main() {
|
| Object od = new D();
|
|
|
| (oc as dynamic).bar; /// 01: runtime error
|
| -}
|
| -
|
|
|
| + // Casts should always evaluate the left-hand side, if only for its effects.
|
| + oc.inc() as dynamic;
|
| + Expect.equals(1, oc.val);
|
| + oc.inc() as Object;
|
| + Expect.equals(2, oc.val);
|
| +}
|
|
|