| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 class A { |
| 6 A() : x = 3; |
| 7 foo() => x; |
| 8 var x; |
| 9 } |
| 10 |
| 11 class B extends A { |
| 12 bar() => 499; |
| 13 } |
| 14 |
| 15 class C extends A { |
| 16 bar() => 42; |
| 17 } |
| 18 |
| 19 main() { |
| 20 // We don't instantiate A, but the codegen still needs to emit (parts of) it |
| 21 // for inheritence purposes. |
| 22 var b = new B(); |
| 23 var c = new C(); |
| 24 Expect.equals(3, b.foo()); |
| 25 Expect.equals(3, c.foo()); |
| 26 Expect.equals(499, b.bar()); |
| 27 Expect.equals(42, c.bar()); |
| 28 } |
| OLD | NEW |