OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import "package:expect/expect.dart"; |
| 6 |
| 7 class Mixin { |
| 8 var field; |
| 9 createIt() { |
| 10 if (field == null) field = 42; |
| 11 } |
| 12 } |
| 13 |
| 14 class A { |
| 15 A(foo); |
| 16 } |
| 17 |
| 18 class B extends A with Mixin { |
| 19 // Because [super] references a synthesized constructor, dart2js |
| 20 // used to not see the null assignment to it. |
| 21 B(foo) : super(foo); |
| 22 } |
| 23 |
| 24 main() { |
| 25 var a = new B(42); |
| 26 a.createIt(); |
| 27 Expect.equals(42, a.field); |
| 28 } |
OLD | NEW |