Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(810)

Side by Side Diff: pkg/analyzer/test/src/task/strong/checker_test.dart

Issue 2221233002: fix #27036, pass definite function types to LUB (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rename Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698