| 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 // Test that we emit warnings for unresolved indexing operations on super. |
| 6 |
| 7 class A { |
| 8 operator[]=(a, b) {} |
| 9 } |
| 10 |
| 11 class B extends A { |
| 12 foo() { |
| 13 super[4] = 42; |
| 14 super[4] += 5; /// 01: static type warning, runtime error |
| 15 return super[2]; /// 02: static type warning, runtime error |
| 16 } |
| 17 } |
| 18 |
| 19 class C { |
| 20 operator[](a) {} |
| 21 } |
| 22 |
| 23 class D extends C { |
| 24 foo() { |
| 25 super[4] = 42; /// 03: static type warning, runtime error |
| 26 super[4] += 5; /// 04: static type warning, runtime error |
| 27 return super[2]; |
| 28 } |
| 29 } |
| 30 |
| 31 class E { |
| 32 foo() { |
| 33 super[4] = 42; /// 05: static type warning, runtime error |
| 34 super[4] += 5; /// 06: static type warning, runtime error |
| 35 return super[2]; /// 07: static type warning, runtime error |
| 36 } |
| 37 } |
| 38 |
| 39 main() { |
| 40 new B().foo(); |
| 41 new D().foo(); |
| 42 new E().foo(); |
| 43 } |
| OLD | NEW |