| 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/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
| 9 | 9 |
| 10 import 'package:dev_compiler/src/testing.dart'; | 10 import 'package:dev_compiler/src/testing.dart'; |
| (...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 void main() { | 928 void main() { |
| 929 F f1 = (x, y) => x + y; | 929 F f1 = (x, y) => x + y; |
| 930 F<int> f2 = /*warning:ClosureWrapLiteral*/(x, y) => x + y; | 930 F<int> f2 = /*warning:ClosureWrapLiteral*/(x, y) => x + y; |
| 931 D f3 = (x, y) => x + y; | 931 D f3 = (x, y) => x + y; |
| 932 Function f4 = (x, y) => x + y; | 932 Function f4 = (x, y) => x + y; |
| 933 f2 = /*warning:ClosureWrap*/f1; | 933 f2 = /*warning:ClosureWrap*/f1; |
| 934 f1 = (int x, int y) => x + y; | 934 f1 = (int x, int y) => x + y; |
| 935 f2 = /*severe:StaticTypeError*/(int x) => -x; | 935 f2 = /*severe:StaticTypeError*/(int x) => -x; |
| 936 } | 936 } |
| 937 ''' | 937 ''' |
| 938 }, wrapClosures: true); | 938 }, wrapClosures: true, inferDownwards: false); |
| 939 }); | 939 }); |
| 940 | 940 |
| 941 test('Generic subtyping: invariance', () { | 941 test('Generic subtyping: invariance', () { |
| 942 testChecker({ | 942 testChecker({ |
| 943 '/main.dart': ''' | 943 '/main.dart': ''' |
| 944 | 944 |
| 945 class A {} | 945 class A {} |
| 946 class B extends A {} | 946 class B extends A {} |
| 947 class C implements A {} | 947 class C implements A {} |
| 948 | 948 |
| (...skipping 1850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2799 f = bar as II2D; | 2799 f = bar as II2D; |
| 2800 f = bar as DD2I; | 2800 f = bar as DD2I; |
| 2801 f = bar as DI2D; | 2801 f = bar as DI2D; |
| 2802 f = bar as ID2D; | 2802 f = bar as ID2D; |
| 2803 f = bar as DD2D; | 2803 f = bar as DD2D; |
| 2804 } | 2804 } |
| 2805 ''' | 2805 ''' |
| 2806 }); | 2806 }); |
| 2807 }); | 2807 }); |
| 2808 } | 2808 } |
| OLD | NEW |