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

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

Issue 2230513002: fix #26155 - optional param passed to positional was not inferred (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add comment 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/generated/static_type_analyzer.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 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_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
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 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/static_type_analyzer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698