| 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 class M { |
| 6 } |
| 7 |
| 8 class P0 { |
| 9 foo() { |
| 10 super.toString(); /// 01: compile-time error |
| 11 super.foo(); /// 02: compile-time error |
| 12 super.bar = 100; /// 03: compile-time error |
| 13 |
| 14 void inner() { |
| 15 super.toString(); /// 04: compile-time error |
| 16 super.foo(); /// 05: compile-time error |
| 17 super.bar = 100; /// 06: compile-time error |
| 18 } |
| 19 inner(); |
| 20 |
| 21 (() { |
| 22 super.toString(); /// 07: compile-time error |
| 23 super.foo(); /// 08: compile-time error |
| 24 super.bar = 100; /// 09: compile-time error |
| 25 })(); |
| 26 |
| 27 return 42; |
| 28 } |
| 29 } |
| 30 |
| 31 class P1 { |
| 32 bar() { |
| 33 super.toString(); /// 10: compile-time error |
| 34 return 87; |
| 35 } |
| 36 |
| 37 // The test method is strategically placed here to try to force the |
| 38 // P1 class and its bar method to be resolved before resolving the |
| 39 // mixin applications. |
| 40 test() { |
| 41 new C(); |
| 42 var d = new D(); |
| 43 var e = new E(); |
| 44 var f = new F(); |
| 45 Expect.equals(42, d.foo()); |
| 46 Expect.equals(87, e.bar()); |
| 47 Expect.equals(99, f.baz()); |
| 48 } |
| 49 } |
| 50 |
| 51 class P2 { |
| 52 baz() { |
| 53 super.toString(); /// 11: compile-time error |
| 54 return 99; |
| 55 } |
| 56 } |
| 57 |
| 58 typedef C = Object with M; |
| 59 typedef D = Object with P0; |
| 60 typedef E = Object with M, P1; |
| 61 typedef F = Object with P2, M; |
| 62 |
| 63 main() { |
| 64 var p1 = new P1(); |
| 65 var p2 = new P2(); |
| 66 Expect.equals(87, p1.bar()); |
| 67 p1.test(); |
| 68 Expect.equals(99, p2.baz()); |
| 69 } |
| OLD | NEW |