| 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 library analyzer.test.src.task.strong.checker_test; | 5 library analyzer.test.src.task.strong.checker_test; |
| 6 | 6 |
| 7 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 7 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 8 | 8 |
| 9 import 'strong_test_helper.dart'; | 9 import 'strong_test_helper.dart'; |
| 10 | 10 |
| (...skipping 2406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2417 void ftf0(/*error:IMPLICIT_DYNAMIC_RETURN*/f(int x)) {} | 2417 void ftf0(/*error:IMPLICIT_DYNAMIC_RETURN*/f(int x)) {} |
| 2418 void ftf1(dynamic f(int x)) {} | 2418 void ftf1(dynamic f(int x)) {} |
| 2419 | 2419 |
| 2420 // function expressions | 2420 // function expressions |
| 2421 var fe0 = (int x) => x as dynamic; | 2421 var fe0 = (int x) => x as dynamic; |
| 2422 var fe1 = (int x) => x; | 2422 var fe1 = (int x) => x; |
| 2423 '''); | 2423 '''); |
| 2424 check(implicitDynamic: false); | 2424 check(implicitDynamic: false); |
| 2425 } | 2425 } |
| 2426 | 2426 |
| 2427 void test_implicitDynamic_static() { |
| 2428 addFile(r''' |
| 2429 class C { |
| 2430 static void test(int body()) {} |
| 2431 } |
| 2432 |
| 2433 void main() { |
| 2434 C.test(/*info:INFERRED_TYPE_CLOSURE*/() { |
| 2435 return 42; |
| 2436 }); |
| 2437 } |
| 2438 '''); |
| 2439 check(implicitDynamic: false); |
| 2440 } |
| 2441 |
| 2427 void test_implicitDynamic_type() { | 2442 void test_implicitDynamic_type() { |
| 2428 addFile(r''' | 2443 addFile(r''' |
| 2429 class C<T> {} | 2444 class C<T> {} |
| 2430 class M1<T extends /*error:IMPLICIT_DYNAMIC_TYPE*/List> {} | 2445 class M1<T extends /*error:IMPLICIT_DYNAMIC_TYPE*/List> {} |
| 2431 class M2<T> {} | 2446 class M2<T> {} |
| 2432 class I<T> {} | 2447 class I<T> {} |
| 2433 class D<T, S> extends /*error:IMPLICIT_DYNAMIC_TYPE*/C | 2448 class D<T, S> extends /*error:IMPLICIT_DYNAMIC_TYPE*/C |
| 2434 with M1, /*error:IMPLICIT_DYNAMIC_TYPE*/M2 | 2449 with M1, /*error:IMPLICIT_DYNAMIC_TYPE*/M2 |
| 2435 implements /*error:IMPLICIT_DYNAMIC_TYPE*/I {} | 2450 implements /*error:IMPLICIT_DYNAMIC_TYPE*/I {} |
| 2436 | 2451 |
| (...skipping 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4073 // Regression test for https://github.com/dart-lang/sdk/issues/25069 | 4088 // Regression test for https://github.com/dart-lang/sdk/issues/25069 |
| 4074 checkFile(''' | 4089 checkFile(''' |
| 4075 typedef int Foo(); | 4090 typedef int Foo(); |
| 4076 void foo() {} | 4091 void foo() {} |
| 4077 void main () { | 4092 void main () { |
| 4078 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); | 4093 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); |
| 4079 } | 4094 } |
| 4080 '''); | 4095 '''); |
| 4081 } | 4096 } |
| 4082 } | 4097 } |
| OLD | NEW |