| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 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 | 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 // SharedOptions=--supermixin | 4 // SharedOptions=--supermixin |
| 5 | 5 |
| 6 // Validate the following text from section 12 ("Mixins") of the spec: | 6 // Validate the following text from section 12 ("Mixins") of the spec: |
| 7 // | 7 // |
| 8 // "A mixin application of the form S with M; defines a class C ... | 8 // "A mixin application of the form S with M; defines a class C ... |
| 9 // ... C declares the same instance members as M ..." | 9 // ... C declares the same instance members as M ..." |
| 10 // | 10 // |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 class M2 extends M1 { m2() => null; } | 27 class M2 extends M1 { m2() => null; } |
| 28 class M3 extends A with B, C { m3() => null; } | 28 class M3 extends A with B, C { m3() => null; } |
| 29 class T1 = D with M1; // declares c() | 29 class T1 = D with M1; // declares c() |
| 30 class T2 = D with M2; // declares m2() | 30 class T2 = D with M2; // declares m2() |
| 31 class T3 = D with M3; // declares m3() | 31 class T3 = D with M3; // declares m3() |
| 32 class T4 extends D with M1 {} // extends a class which declares c() | 32 class T4 extends D with M1 {} // extends a class which declares c() |
| 33 class T5 extends D with M2 {} // extends a class which declares m2() | 33 class T5 extends D with M2 {} // extends a class which declares m2() |
| 34 class T6 extends D with M3 {} // extends a class which declares m3() | 34 class T6 extends D with M3 {} // extends a class which declares m3() |
| 35 | 35 |
| 36 main() { | 36 main() { |
| 37 /// none: static type warning, ok |
| 37 new T1().a(); /// 01: static type warning, runtime error | 38 new T1().a(); /// 01: static type warning, runtime error |
| 38 new T1().b(); /// 02: static type warning, runtime error | 39 new T1().b(); /// 02: static type warning, runtime error |
| 39 new T1().c(); /// 03: ok | 40 new T1().c(); /// 03: static type warning, ok |
| 40 new T2().a(); /// 04: static type warning, runtime error | 41 new T2().a(); /// 04: static type warning, runtime error |
| 41 new T2().b(); /// 05: static type warning, runtime error | 42 new T2().b(); /// 05: static type warning, runtime error |
| 42 new T2().c(); /// 06: static type warning, runtime error | 43 new T2().c(); /// 06: static type warning, runtime error |
| 43 new T2().m2(); /// 07: ok | 44 new T2().m2(); /// 07: static type warning, ok |
| 44 new T3().a(); /// 08: static type warning, runtime error | 45 new T3().a(); /// 08: static type warning, runtime error |
| 45 new T3().b(); /// 09: static type warning, runtime error | 46 new T3().b(); /// 09: static type warning, runtime error |
| 46 new T3().c(); /// 10: static type warning, runtime error | 47 new T3().c(); /// 10: static type warning, runtime error |
| 47 new T3().m3(); /// 11: ok | 48 new T3().m3(); /// 11: static type warning, ok |
| 48 new T4().a(); /// 12: static type warning, runtime error | 49 new T4().a(); /// 12: static type warning, runtime error |
| 49 new T4().b(); /// 13: static type warning, runtime error | 50 new T4().b(); /// 13: static type warning, runtime error |
| 50 new T4().c(); /// 14: ok | 51 new T4().c(); /// 14: static type warning, ok |
| 51 new T5().a(); /// 15: static type warning, runtime error | 52 new T5().a(); /// 15: static type warning, runtime error |
| 52 new T5().b(); /// 16: static type warning, runtime error | 53 new T5().b(); /// 16: static type warning, runtime error |
| 53 new T5().c(); /// 17: static type warning, runtime error | 54 new T5().c(); /// 17: static type warning, runtime error |
| 54 new T5().m2(); /// 18: ok | 55 new T5().m2(); /// 18: static type warning, ok |
| 55 new T6().a(); /// 19: static type warning, runtime error | 56 new T6().a(); /// 19: static type warning, runtime error |
| 56 new T6().b(); /// 20: static type warning, runtime error | 57 new T6().b(); /// 20: static type warning, runtime error |
| 57 new T6().c(); /// 21: static type warning, runtime error | 58 new T6().c(); /// 21: static type warning, runtime error |
| 58 new T6().m3(); /// 22: ok | 59 new T6().m3(); /// 22: static type warning, ok |
| 59 } | 60 } |
| OLD | NEW |