OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // Regression test case for dart2js bug where the getter for y wasn't | 5 // Regression test case for dart2js bug where the getter for y wasn't |
6 // properly mixed in. | 6 // properly mixed in. |
7 | 7 |
8 import "package:expect/expect.dart"; | |
9 | |
10 class C { | 8 class C { |
11 int x; | 9 int x; |
12 int get y => x; | 10 int get y => x; |
13 } | 11 } |
14 | 12 |
15 class E { | 13 class E { |
16 int z = 10; | 14 int z = 10; |
17 } | 15 } |
18 | 16 |
19 class D extends E with C { | 17 class D extends E with C { |
20 int w = 42; | 18 int w = 42; |
21 } | 19 } |
22 | 20 |
23 main() { | 21 main() { |
24 var d = new D(); | 22 var d = new D(); |
25 d.x = 37; | 23 d.x = 37; |
26 Expect.equals(37, d.x); | 24 Expect.equals(37, d.x); |
27 Expect.equals(10, d.z); | 25 Expect.equals(10, d.z); |
28 Expect.equals(42, d.w); | 26 Expect.equals(42, d.w); |
29 Expect.equals(37, d.y); | 27 Expect.equals(37, d.y); |
30 } | 28 } |
OLD | NEW |