Chromium Code Reviews| 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 | |
|
Johnni Winther
2013/01/22 11:46:44
There is no case where the constructor is synthesi
kasperl
2013/01/22 11:50:45
Well, that is generally the case for mixins so tha
| |
| 5 class M0 { | |
| 6 factory M0(a,b,c) => null; | |
| 7 factory M0.named() => null; | |
| 8 } | |
| 9 | |
| 10 class M1 { | |
| 11 M1(); | |
| 12 } | |
| 13 | |
| 14 class M2 { | |
| 15 M2.named(); | |
| 16 } | |
| 17 | |
| 18 typedef C0 = Object with M0; | |
| 19 typedef C1 = Object with M1; /// 01: compile-time error | |
| 20 typedef C2 = Object with M2; /// 02: compile-time error | |
| 21 typedef C3 = Object with M0, M1; /// 03: compile-time error | |
| 22 typedef C4 = Object with M1, M0; /// 04: compile-time error | |
| 23 typedef C5 = Object with M0, M2; /// 05: compile-time error | |
| 24 typedef C6 = Object with M2, M0; /// 06: compile-time error | |
| 25 | |
| 26 class D0 extends Object with M0 { } | |
| 27 class D1 extends Object with M1 { } /// 07: compile-time error | |
| 28 class D2 extends Object with M2 { } /// 08: compile-time error | |
| 29 class D3 extends Object with M0, M1 { } /// 09: compile-time error | |
| 30 class D4 extends Object with M1, M0 { } /// 10: compile-time error | |
| 31 class D5 extends Object with M0, M2 { } /// 11: compile-time error | |
| 32 class D6 extends Object with M2, M0 { } /// 12: compile-time error | |
| 33 | |
| 34 main() { | |
| 35 new C0(); | |
| 36 new C1(); /// 01: continued | |
| 37 new C2(); /// 02: continued | |
| 38 new C3(); /// 03: continued | |
| 39 new C4(); /// 04: continued | |
| 40 new C5(); /// 05: continued | |
| 41 new C6(); /// 06: continued | |
| 42 | |
| 43 new D0(); | |
| 44 new D1(); /// 07: continued | |
| 45 new D2(); /// 08: continued | |
| 46 new D3(); /// 09: continued | |
| 47 new D4(); /// 10: continued | |
| 48 new D5(); /// 11: continued | |
| 49 new D6(); /// 12: continued | |
| 50 | |
| 51 new C0(1,2,3); /// 13: static type warning, runtime error | |
| 52 new C0.named(); /// 14: static type warning, runtime error | |
| 53 new D0(1,2,3); /// 15: static type warning, runtime error | |
| 54 new D0.named(); /// 16: static type warning, runtime error | |
| 55 } | |
| OLD | NEW |