| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// General type checking tests | 5 /// General type checking tests |
| 6 library dev_compiler.test.checker_test; | 6 library dev_compiler.test.checker_test; |
| 7 | 7 |
| 8 import 'package:unittest/compact_vm_config.dart'; | 8 import 'package:unittest/compact_vm_config.dart'; |
| 9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
| 10 | 10 |
| (...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1676 B f4; | 1676 B f4; |
| 1677 } | 1677 } |
| 1678 | 1678 |
| 1679 class Child extends Base { | 1679 class Child extends Base { |
| 1680 /*severe:InvalidMethodOverride*/A get f1 => null; | 1680 /*severe:InvalidMethodOverride*/A get f1 => null; |
| 1681 C get f2 => null; | 1681 C get f2 => null; |
| 1682 get f3 => null; | 1682 get f3 => null; |
| 1683 /*severe:InvalidMethodOverride*/dynamic get f4 => null; | 1683 /*severe:InvalidMethodOverride*/dynamic get f4 => null; |
| 1684 } | 1684 } |
| 1685 ''' | 1685 ''' |
| 1686 }); | 1686 }, inferFromOverrides: true); |
| 1687 }); | 1687 }); |
| 1688 | 1688 |
| 1689 test('setter/setter override', () { | 1689 test('setter/setter override', () { |
| 1690 testChecker({ | 1690 testChecker({ |
| 1691 '/main.dart': ''' | 1691 '/main.dart': ''' |
| 1692 class A {} | 1692 class A {} |
| 1693 class B extends A {} | 1693 class B extends A {} |
| 1694 class C extends B {} | 1694 class C extends B {} |
| 1695 | 1695 |
| 1696 abstract class Base { | 1696 abstract class Base { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1762 | 1762 |
| 1763 class Child extends Base { | 1763 class Child extends Base { |
| 1764 /*severe:InvalidMethodOverride*/A m1(A value) {} | 1764 /*severe:InvalidMethodOverride*/A m1(A value) {} |
| 1765 /*severe:InvalidMethodOverride*/C m2(C value) {} | 1765 /*severe:InvalidMethodOverride*/C m2(C value) {} |
| 1766 /*severe:InvalidMethodOverride*/A m3(C value) {} | 1766 /*severe:InvalidMethodOverride*/A m3(C value) {} |
| 1767 C m4(A value) {} | 1767 C m4(A value) {} |
| 1768 m5(value) {} | 1768 m5(value) {} |
| 1769 /*severe:InvalidMethodOverride*/dynamic m6(dynamic value) {} | 1769 /*severe:InvalidMethodOverride*/dynamic m6(dynamic value) {} |
| 1770 } | 1770 } |
| 1771 ''' | 1771 ''' |
| 1772 }); | 1772 }, inferFromOverrides: true); |
| 1773 }); | 1773 }); |
| 1774 | 1774 |
| 1775 test('binary operators', () { | 1775 test('binary operators', () { |
| 1776 testChecker({ | 1776 testChecker({ |
| 1777 '/main.dart': ''' | 1777 '/main.dart': ''' |
| 1778 class A { | 1778 class A { |
| 1779 A operator *(B b) {} | 1779 A operator *(B b) {} |
| 1780 A operator /(B b) {} | 1780 A operator /(B b) {} |
| 1781 A operator ~/(B b) {} | 1781 A operator ~/(B b) {} |
| 1782 A operator %(B b) {} | 1782 A operator %(B b) {} |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2704 '/main.dart': ''' | 2704 '/main.dart': ''' |
| 2705 class A {} | 2705 class A {} |
| 2706 class T1 implements A { | 2706 class T1 implements A { |
| 2707 /*severe:InferableOverride*/toString() {} | 2707 /*severe:InferableOverride*/toString() {} |
| 2708 } | 2708 } |
| 2709 ''' | 2709 ''' |
| 2710 }, inferFromOverrides: false); | 2710 }, inferFromOverrides: false); |
| 2711 }); | 2711 }); |
| 2712 }); | 2712 }); |
| 2713 } | 2713 } |
| OLD | NEW |