| 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 '../../../reflective_tests.dart'; | 7 import '../../../reflective_tests.dart'; |
| 8 import 'strong_test_helper.dart'; | 8 import 'strong_test_helper.dart'; |
| 9 | 9 |
| 10 void main() { | 10 void main() { |
| (...skipping 2959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2970 b = b ?? new A(); | 2970 b = b ?? new A(); |
| 2971 | 2971 |
| 2972 // downwards inference | 2972 // downwards inference |
| 2973 C<int> c, d; | 2973 C<int> c, d; |
| 2974 c ??= /*info:INFERRED_TYPE_ALLOCATION*/new C(); | 2974 c ??= /*info:INFERRED_TYPE_ALLOCATION*/new C(); |
| 2975 d = d ?? /*info:INFERRED_TYPE_ALLOCATION*/new C(); | 2975 d = d ?? /*info:INFERRED_TYPE_ALLOCATION*/new C(); |
| 2976 } | 2976 } |
| 2977 '''); | 2977 '''); |
| 2978 } | 2978 } |
| 2979 | 2979 |
| 2980 void test_optionalParams() { |
| 2981 // Regression test for https://github.com/dart-lang/sdk/issues/26155 |
| 2982 checkFile(r''' |
| 2983 void takesF(void f(int x)) { |
| 2984 takesF(/*info:INFERRED_TYPE_CLOSURE,info:INFERRED_TYPE_CLOSURE*/([x]) { bool z
= x.isEven; }); |
| 2985 takesF(/*info:INFERRED_TYPE_CLOSURE*/(y) { bool z = y.isEven; }); |
| 2986 } |
| 2987 '''); |
| 2988 } |
| 2989 |
| 2980 void test_privateOverride() { | 2990 void test_privateOverride() { |
| 2981 addFile( | 2991 addFile( |
| 2982 ''' | 2992 ''' |
| 2983 import 'main.dart' as main; | 2993 import 'main.dart' as main; |
| 2984 | 2994 |
| 2985 class Base { | 2995 class Base { |
| 2986 var f1; | 2996 var f1; |
| 2987 var _f2; | 2997 var _f2; |
| 2988 var _f3; | 2998 var _f3; |
| 2989 get _f4 => null; | 2999 get _f4 => null; |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3660 // Regression test for https://github.com/dart-lang/sdk/issues/25069 | 3670 // Regression test for https://github.com/dart-lang/sdk/issues/25069 |
| 3661 checkFile(''' | 3671 checkFile(''' |
| 3662 typedef int Foo(); | 3672 typedef int Foo(); |
| 3663 void foo() {} | 3673 void foo() {} |
| 3664 void main () { | 3674 void main () { |
| 3665 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); | 3675 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); |
| 3666 } | 3676 } |
| 3667 '''); | 3677 '''); |
| 3668 } | 3678 } |
| 3669 } | 3679 } |
| OLD | NEW |