OLD | NEW |
1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 import 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 | 6 |
7 class A { | 7 class A { |
8 A(this.y, int w) : this.w = w; | 8 A(this.y, int w) : this.w = w; |
9 var x = 8; | 9 var x = 8; |
10 var y; | 10 var y; |
11 var w; | 11 var w; |
12 } | 12 } |
13 | 13 |
14 class B extends A { | 14 class B extends A { |
15 var z = 0; | 15 var z = 0; |
16 B() : super(5, 42); | 16 B() : super(5, 42); |
17 } | 17 } |
18 | 18 |
19 main() { | 19 main() { |
20 A a = new B(); | 20 A a = new B(); |
21 Expect.equals(8, a.x); | 21 Expect.equals(8, a.x); |
22 Expect.equals(5, a.y); | 22 Expect.equals(5, a.y); |
23 Expect.equals(0, a.z); | 23 Expect.equals(0, a.z); |
24 Expect.equals(42, a.w); | 24 Expect.equals(42, a.w); |
25 } | 25 } |
26 | 26 |
27 | 27 |
28 | 28 |
OLD | NEW |