| 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 // TODO(jmesserly): this file needs to be refactored, it's a port from | 5 // TODO(jmesserly): this file needs to be refactored, it's a port from |
| 6 // package:dev_compiler's tests | 6 // package:dev_compiler's tests |
| 7 /// General type checking tests | 7 /// General type checking tests |
| 8 library analyzer.test.src.task.strong.checker_test; | 8 library analyzer.test.src.task.strong.checker_test; |
| 9 | 9 |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2044 /*severe:INVALID_METHOD_OVERRIDE*/ToVoid<dynamic> get g => null; | 2044 /*severe:INVALID_METHOD_OVERRIDE*/ToVoid<dynamic> get g => null; |
| 2045 } | 2045 } |
| 2046 '''); | 2046 '''); |
| 2047 }); | 2047 }); |
| 2048 | 2048 |
| 2049 test('setter override, fuzzy arrows', () { | 2049 test('setter override, fuzzy arrows', () { |
| 2050 checkFile(''' | 2050 checkFile(''' |
| 2051 typedef void ToVoid<T>(T x); | 2051 typedef void ToVoid<T>(T x); |
| 2052 class F { | 2052 class F { |
| 2053 void set f(ToVoid<dynamic> x) {} | 2053 void set f(ToVoid<dynamic> x) {} |
| 2054 void set g(ToVoid<int> x) {} | 2054 void set g(ToVoid<int> x) {} |
| 2055 void set h(dynamic x) {} | 2055 void set h(dynamic x) {} |
| 2056 void set i(int x) {} | 2056 void set i(int x) {} |
| 2057 } | 2057 } |
| 2058 | 2058 |
| 2059 class G extends F { | 2059 class G extends F { |
| 2060 /*severe:INVALID_METHOD_OVERRIDE*/void set f(ToVoid<int> x) {} | 2060 /*severe:INVALID_METHOD_OVERRIDE*/void set f(ToVoid<int> x) {} |
| 2061 void set g(ToVoid<dynamic> x) {} | 2061 void set g(ToVoid<dynamic> x) {} |
| 2062 void set h(int x) {} | 2062 void set h(int x) {} |
| 2063 /*severe:INVALID_METHOD_OVERRIDE*/void set i(dynamic x) {} | 2063 /*severe:INVALID_METHOD_OVERRIDE*/void set i(dynamic x) {} |
| 2064 } | 2064 } |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2336 double y = 0.0; | 2336 double y = 0.0; |
| 2337 y += 5; | 2337 y += 5; |
| 2338 y += 3.14; | 2338 y += 3.14; |
| 2339 | 2339 |
| 2340 num z = 0; | 2340 num z = 0; |
| 2341 z += 5; | 2341 z += 5; |
| 2342 z += 3.14; | 2342 z += 3.14; |
| 2343 | 2343 |
| 2344 x = /*info:DOWN_CAST_IMPLICIT*/x + z; | 2344 x = /*info:DOWN_CAST_IMPLICIT*/x + z; |
| 2345 x += /*info:DOWN_CAST_IMPLICIT*/z; | 2345 x += /*info:DOWN_CAST_IMPLICIT*/z; |
| 2346 y = /*info:DOWN_CAST_IMPLICIT*/y + z; | 2346 y = y + z; |
| 2347 y += /*info:DOWN_CAST_IMPLICIT*/z; | 2347 y += z; |
| 2348 | 2348 |
| 2349 dynamic w = 42; | 2349 dynamic w = 42; |
| 2350 x += /*info:DYNAMIC_CAST*/w; | 2350 x += /*info:DYNAMIC_CAST*/w; |
| 2351 y += /*info:DYNAMIC_CAST*/w; | 2351 y += /*info:DYNAMIC_CAST*/w; |
| 2352 z += /*info:DYNAMIC_CAST*/w; | 2352 z += /*info:DYNAMIC_CAST*/w; |
| 2353 | 2353 |
| 2354 A a = new A(); | 2354 A a = new A(); |
| 2355 B b = new B(); | 2355 B b = new B(); |
| 2356 var c = foo(); | 2356 var c = foo(); |
| 2357 a = a * b; | 2357 a = a * b; |
| (...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3307 | 3307 |
| 3308 baz1() sync* { yield* /*info:DYNAMIC_CAST*/x; } | 3308 baz1() sync* { yield* /*info:DYNAMIC_CAST*/x; } |
| 3309 Iterable baz2() sync* { yield* /*info:DYNAMIC_CAST*/x; } | 3309 Iterable baz2() sync* { yield* /*info:DYNAMIC_CAST*/x; } |
| 3310 Iterable<int> baz3() sync* { yield* /*warning:DOWN_CAST_COMPOSITE*/x; } | 3310 Iterable<int> baz3() sync* { yield* /*warning:DOWN_CAST_COMPOSITE*/x; } |
| 3311 Iterable<int> baz4() sync* { yield* bar3(); } | 3311 Iterable<int> baz4() sync* { yield* bar3(); } |
| 3312 Iterable<int> baz5() sync* { yield* /*info:INFERRED_TYPE_ALLOCATION*/new
List(); } | 3312 Iterable<int> baz5() sync* { yield* /*info:INFERRED_TYPE_ALLOCATION*/new
List(); } |
| 3313 '''); | 3313 '''); |
| 3314 }); | 3314 }); |
| 3315 }); | 3315 }); |
| 3316 } | 3316 } |
| OLD | NEW |