OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016, 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 import 'package:expect/expect.dart'; |
| 6 |
| 7 abstract class B { |
| 8 int get x; |
| 9 } |
| 10 |
| 11 class C { |
| 12 int get x => 42; |
| 13 } |
| 14 |
| 15 class D extends C with B { |
| 16 final int x; |
| 17 |
| 18 D(this.x); |
| 19 } |
| 20 |
| 21 |
| 22 class C2 { |
| 23 int get x => 42; |
| 24 } |
| 25 |
| 26 abstract class B2 extends C2 { |
| 27 int get x; |
| 28 } |
| 29 |
| 30 class D2 extends B2 { |
| 31 final int x; |
| 32 |
| 33 D2(this.x); |
| 34 } |
| 35 |
| 36 |
| 37 void main() { |
| 38 var d = new D(17); |
| 39 Expect.equals(d.x, 17); |
| 40 |
| 41 var d2 = new D2(17); |
| 42 Expect.equals(d.x, 17); |
| 43 } |
OLD | NEW |