| 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 2968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2979 b = b ?? new A(); | 2979 b = b ?? new A(); |
| 2980 | 2980 |
| 2981 // downwards inference | 2981 // downwards inference |
| 2982 C<int> c, d; | 2982 C<int> c, d; |
| 2983 c ??= /*info:INFERRED_TYPE_ALLOCATION*/new C(); | 2983 c ??= /*info:INFERRED_TYPE_ALLOCATION*/new C(); |
| 2984 d = d ?? /*info:INFERRED_TYPE_ALLOCATION*/new C(); | 2984 d = d ?? /*info:INFERRED_TYPE_ALLOCATION*/new C(); |
| 2985 } | 2985 } |
| 2986 '''); | 2986 '''); |
| 2987 } | 2987 } |
| 2988 | 2988 |
| 2989 void test_nullCoalescingStrictArrow() { |
| 2990 checkFile(r''' |
| 2991 bool _alwaysTrue(x) => true; |
| 2992 typedef bool TakesA<T>(T t); |
| 2993 class C<T> { |
| 2994 TakesA<T> g; |
| 2995 C(TakesA<T> f) |
| 2996 : g = f ?? _alwaysTrue; |
| 2997 C.a() : g = _alwaysTrue; |
| 2998 } |
| 2999 '''); |
| 3000 } |
| 3001 |
| 2989 void test_optionalParams() { | 3002 void test_optionalParams() { |
| 2990 // Regression test for https://github.com/dart-lang/sdk/issues/26155 | 3003 // Regression test for https://github.com/dart-lang/sdk/issues/26155 |
| 2991 checkFile(r''' | 3004 checkFile(r''' |
| 2992 void takesF(void f(int x)) { | 3005 void takesF(void f(int x)) { |
| 2993 takesF(/*info:INFERRED_TYPE_CLOSURE,info:INFERRED_TYPE_CLOSURE*/([x]) { bool z
= x.isEven; }); | 3006 takesF(/*info:INFERRED_TYPE_CLOSURE,info:INFERRED_TYPE_CLOSURE*/([x]) { bool z
= x.isEven; }); |
| 2994 takesF(/*info:INFERRED_TYPE_CLOSURE*/(y) { bool z = y.isEven; }); | 3007 takesF(/*info:INFERRED_TYPE_CLOSURE*/(y) { bool z = y.isEven; }); |
| 2995 } | 3008 } |
| 2996 '''); | 3009 '''); |
| 2997 } | 3010 } |
| 2998 | 3011 |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3717 // Regression test for https://github.com/dart-lang/sdk/issues/25069 | 3730 // Regression test for https://github.com/dart-lang/sdk/issues/25069 |
| 3718 checkFile(''' | 3731 checkFile(''' |
| 3719 typedef int Foo(); | 3732 typedef int Foo(); |
| 3720 void foo() {} | 3733 void foo() {} |
| 3721 void main () { | 3734 void main () { |
| 3722 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); | 3735 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); |
| 3723 } | 3736 } |
| 3724 '''); | 3737 '''); |
| 3725 } | 3738 } |
| 3726 } | 3739 } |
| OLD | NEW |