Index: tests/language/override_inheritance_no_such_method_test.dart |
diff --git a/tests/language/override_inheritance_no_such_method_test.dart b/tests/language/override_inheritance_no_such_method_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..261a21ead9a2caea035eccf693adc6523af1391b |
--- /dev/null |
+++ b/tests/language/override_inheritance_no_such_method_test.dart |
@@ -0,0 +1,56 @@ |
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+// Test use of @proxy and noSuchMethod in relation to abstract methods in |
+// concrete classes. |
+ |
+abstract class A { |
+ method6(); /// 06: static type warning |
+ method7(); /// 07: ok |
+ method8(); /// 08: ok |
+} |
+ |
+abstract class I { |
+ method9(); /// 09: static type warning |
+ method10(); /// 10: ok |
+ method11(); /// 11: ok |
+} |
+ |
+@proxy /// 02: ok |
+@proxy /// 07: continued |
+@proxy /// 10: continued |
+class Class1 extends A implements I { |
+ method1(); /// 01: static type warning |
+ |
+ method2(); /// 02: continued |
karlklose
2014/01/28 12:27:45
Not sure about this one.
Johnni Winther
2014/01/31 12:29:30
Changed to expect static warning (together with 07
|
+ |
+ noSuchMethod(_) => null; /// 03: ok |
+ method3(); /// 03: continued |
+ |
+ noSuchMethod(_, [__]) => null; /// 04: ok |
+ method4(); /// 04: continued |
+ |
+ noSuchMethod(_); /// 05: ok |
+ method5(); /// 05: continued |
+ |
+ noSuchMethod(_) => null; /// 08: continued |
+ |
+ noSuchMethod(_) => null; /// 11: continued |
+} |
+ |
+@proxy /// 12: static type warning |
+class B { |
+ method12(); /// 12: continued |
+ |
+ noSuchMethod(_) => null; /// 13: static type warning |
+ method13(); /// 13: continued |
+} |
+ |
+class Class2 extends B { |
+} |
+ |
+main() { |
+ new Class1(); |
+ new Class2(); |
+} |