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

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: small refactor for checker & InvocationExpressions 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
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 2959 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_nullCoalescingStrictArrow() {
2981 checkFile(r'''
2982 bool _alwaysTrue(x) => true;
2983 typedef bool TakesA<T>(T t);
2984 class C<T> {
2985 TakesA<T> g;
2986 C(TakesA<T> f)
2987 : g = f ?? _alwaysTrue;
2988 C.a() : g = _alwaysTrue;
2989 }
2990 ''');
2991 }
2992
2980 void test_privateOverride() { 2993 void test_privateOverride() {
2981 addFile( 2994 addFile(
2982 ''' 2995 '''
2983 import 'main.dart' as main; 2996 import 'main.dart' as main;
2984 2997
2985 class Base { 2998 class Base {
2986 var f1; 2999 var f1;
2987 var _f2; 3000 var _f2;
2988 var _f3; 3001 var _f3;
2989 get _f4 => null; 3002 get _f4 => null;
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
3660 // Regression test for https://github.com/dart-lang/sdk/issues/25069 3673 // Regression test for https://github.com/dart-lang/sdk/issues/25069
3661 checkFile(''' 3674 checkFile('''
3662 typedef int Foo(); 3675 typedef int Foo();
3663 void foo() {} 3676 void foo() {}
3664 void main () { 3677 void main () {
3665 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); 3678 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo();
3666 } 3679 }
3667 '''); 3680 ''');
3668 } 3681 }
3669 } 3682 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698