| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 | 4 |
| 5 // Test static warnings for method overrides. | 5 // Test static warnings for method overrides. |
| 6 | 6 |
| 7 class A { | 7 class A { |
| 8 method1() => null; /// 01: ok | 8 method1() => null; //# 01: ok |
| 9 method2(a) => null; /// 02: ok | 9 method2(a) => null; //# 02: ok |
| 10 method3(a, b, c, d) => null; /// 03: ok | 10 method3(a, b, c, d) => null; //# 03: ok |
| 11 method4() => null; /// 04: static type warning | 11 method4() => null; //# 04: static type warning |
| 12 method6(a, b, c) => null; /// 06: static type warning | 12 method6(a, b, c) => null; //# 06: static type warning |
| 13 method7([a]) => null; /// 07: ok | 13 method7([a]) => null; //# 07: ok |
| 14 method8([a, b]) => null; /// 08: ok | 14 method8([a, b]) => null; //# 08: ok |
| 15 method9([a, b, c]) => null; /// 09: ok | 15 method9([a, b, c]) => null; //# 09: ok |
| 16 method10([a]) => null; /// 10: ok | 16 method10([a]) => null; //# 10: ok |
| 17 method11(a) => null; /// 11: static type warning | 17 method11(a) => null; //# 11: static type warning |
| 18 method12(a, [b]) => null; /// 12: static type warning | 18 method12(a, [b]) => null; //# 12: static type warning |
| 19 method13(a, [b]) => null; /// 13: static type warning | 19 method13(a, [b]) => null; //# 13: static type warning |
| 20 method14(a, b, [c, d, e]) => null; /// 14: static type warning | 20 method14(a, b, [c, d, e]) => null; //# 14: static type warning |
| 21 method15({a}) => null; /// 15: ok | 21 method15({a}) => null; //# 15: ok |
| 22 method16({a, b}) => null; /// 16: ok | 22 method16({a, b}) => null; //# 16: ok |
| 23 method17({a, b, c}) => null; /// 17: ok | 23 method17({a, b, c}) => null; //# 17: ok |
| 24 method18(d, {a, b, c}) => null; /// 18: ok | 24 method18(d, {a, b, c}) => null; //# 18: ok |
| 25 method19({a}) => null; /// 19: static type warning | 25 method19({a}) => null; //# 19: static type warning |
| 26 method20({a, b}) => null; /// 20: static type warning | 26 method20({a, b}) => null; //# 20: static type warning |
| 27 method21({a, b, c, d}) => null; /// 21: static type warning | 27 method21({a, b, c, d}) => null; //# 21: static type warning |
| 28 | 28 |
| 29 method22(int a) => null; /// 22: ok | 29 method22(int a) => null; //# 22: ok |
| 30 method23(int a) => null; /// 23: ok | 30 method23(int a) => null; //# 23: ok |
| 31 void method24() {} /// 24: ok | 31 void method24() {} //# 24: ok |
| 32 method25() => null; /// 25: ok | 32 method25() => null; //# 25: ok |
| 33 void method26() {} /// 26: ok | 33 void method26() {} //# 26: ok |
| 34 int method27() => null; /// 27: static type warning | 34 int method27() => null; //# 27: static type warning |
| 35 method28(int a) => null; /// 28: ok | 35 method28(int a) => null; //# 28: ok |
| 36 method29(int a) => null; /// 29: ok | 36 method29(int a) => null; //# 29: ok |
| 37 method30(int a) => null; /// 30: static type warning | 37 method30(int a) => null; //# 30: static type warning |
| 38 } | 38 } |
| 39 | 39 |
| 40 class B extends A { | 40 class B extends A { |
| 41 method28(num a) => null; /// 28: continued | 41 method28(num a) => null; //# 28: continued |
| 42 method29(a) => null; /// 29: continued | 42 method29(a) => null; //# 29: continued |
| 43 } | 43 } |
| 44 | 44 |
| 45 abstract class I { | 45 abstract class I { |
| 46 method5() => null; /// 05: static type warning | 46 method5() => null; //# 05: static type warning |
| 47 method31(int a) => null; /// 31: static type warning | 47 method31(int a) => null; //# 31: static type warning |
| 48 method32(int a) => null; /// 32: static type warning | 48 method32(int a) => null; //# 32: static type warning |
| 49 method33(num a) => null; /// 33: static type warning | 49 method33(num a) => null; //# 33: static type warning |
| 50 } | 50 } |
| 51 | 51 |
| 52 abstract class J { | 52 abstract class J { |
| 53 method31(num a) => null; /// 31: continued | 53 method31(num a) => null; //# 31: continued |
| 54 method32(double a) => null; /// 32: continued | 54 method32(double a) => null; //# 32: continued |
| 55 method33(int a) => null; /// 33: continued | 55 method33(int a) => null; //# 33: continued |
| 56 } | 56 } |
| 57 | 57 |
| 58 class Class extends B implements I, J { | 58 class Class extends B implements I, J { |
| 59 method1() => null; /// 01: continued | 59 method1() => null; //# 01: continued |
| 60 method2(b) => null; /// 02: continued | 60 method2(b) => null; //# 02: continued |
| 61 method3(b, a, d, c) => null; /// 03: continued | 61 method3(b, a, d, c) => null; //# 03: continued |
| 62 method4(a) => null; /// 04: continued | 62 method4(a) => null; //# 04: continued |
| 63 method5(a) => null; /// 05: continued | 63 method5(a) => null; //# 05: continued |
| 64 method6(a, b, c, d) => null; /// 06: continued | 64 method6(a, b, c, d) => null; //# 06: continued |
| 65 method7([a]) => null; /// 07: continued | 65 method7([a]) => null; //# 07: continued |
| 66 method8([b, a]) => null; /// 08: continued | 66 method8([b, a]) => null; //# 08: continued |
| 67 method9([b, d, a, c]) => null; /// 09: continued | 67 method9([b, d, a, c]) => null; //# 09: continued |
| 68 method10([a]) => null; /// 10: continued | 68 method10([a]) => null; //# 10: continued |
| 69 method11() => null; /// 11: continued | 69 method11() => null; //# 11: continued |
| 70 method12(a) => null; /// 12: continued | 70 method12(a) => null; //# 12: continued |
| 71 method13([a]) => null; /// 13: continued | 71 method13([a]) => null; //# 13: continued |
| 72 method14([a, b, c, d]) => null; /// 14: continued | 72 method14([a, b, c, d]) => null; //# 14: continued |
| 73 method15({a}) => null; /// 15: continued | 73 method15({a}) => null; //# 15: continued |
| 74 method16({b, a}) => null; /// 16: continued | 74 method16({b, a}) => null; //# 16: continued |
| 75 method17({b, c, a, d}) => null; /// 17: continued | 75 method17({b, c, a, d}) => null; //# 17: continued |
| 76 method18(e, {b, c, a, d}) => null; /// 18: continued | 76 method18(e, {b, c, a, d}) => null; //# 18: continued |
| 77 method19() => null; /// 19: continued | 77 method19() => null; //# 19: continued |
| 78 method20({b}) => null; /// 20: continued | 78 method20({b}) => null; //# 20: continued |
| 79 method21({a, e, d, c}) => null; /// 21: continued | 79 method21({a, e, d, c}) => null; //# 21: continued |
| 80 | 80 |
| 81 method22(int a) => null; /// 22: continued | 81 method22(int a) => null; //# 22: continued |
| 82 method23(num a) => null; /// 23: continued | 82 method23(num a) => null; //# 23: continued |
| 83 method24() => null; /// 24: continued | 83 method24() => null; //# 24: continued |
| 84 void method25() {} /// 25: continued | 84 void method25() {} //# 25: continued |
| 85 int method26() => null; /// 26: continued | 85 int method26() => null; //# 26: continued |
| 86 void method27() {} /// 27: continued | 86 void method27() {} //# 27: continued |
| 87 method28(double a) => null; /// 28: continued | 87 method28(double a) => null; //# 28: continued |
| 88 method29(String a) => null; /// 29: continued | 88 method29(String a) => null; //# 29: continued |
| 89 method30(String a) => null; /// 30: continued | 89 method30(String a) => null; //# 30: continued |
| 90 } | 90 } |
| 91 | 91 |
| 92 class SubClass extends Class { | 92 class SubClass extends Class { |
| 93 method31(double a) => null; /// 31: continued | 93 method31(double a) => null; //# 31: continued |
| 94 method32(String a) => null; /// 32: continued | 94 method32(String a) => null; //# 32: continued |
| 95 method33(double a) => null; /// 33: continued | 95 method33(double a) => null; //# 33: continued |
| 96 } | 96 } |
| 97 | 97 |
| 98 main() { | 98 main() { |
| 99 new SubClass(); | 99 new SubClass(); |
| 100 } | 100 } |
| OLD | NEW |