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

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

Issue 2757813002: don't produce errors from inference for downward inferred type variables (Closed)
Patch Set: fix test expectation Created 3 years, 9 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 'package:test_reflective_loader/test_reflective_loader.dart'; 7 import 'package:test_reflective_loader/test_reflective_loader.dart';
8 8
9 import 'strong_test_helper.dart'; 9 import 'strong_test_helper.dart';
10 10
(...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after
2040 /*=T*/ foo/*<T>*/(/*=T*/ x, /*=T*/ y) => x; 2040 /*=T*/ foo/*<T>*/(/*=T*/ x, /*=T*/ y) => x;
2041 /*=T*/ bar/*<T>*/({/*=T*/ x, /*=T*/ y}) => x; 2041 /*=T*/ bar/*<T>*/({/*=T*/ x, /*=T*/ y}) => x;
2042 2042
2043 main() { 2043 main() {
2044 String x; 2044 String x;
2045 // resolving these shouldn't crash. 2045 // resolving these shouldn't crash.
2046 foo/*error:EXTRA_POSITIONAL_ARGUMENTS*/(1, 2, 3); 2046 foo/*error:EXTRA_POSITIONAL_ARGUMENTS*/(1, 2, 3);
2047 x = foo/*error:EXTRA_POSITIONAL_ARGUMENTS*/('1', '2', '3'); 2047 x = foo/*error:EXTRA_POSITIONAL_ARGUMENTS*/('1', '2', '3');
2048 foo/*error:NOT_ENOUGH_REQUIRED_ARGUMENTS*/(1); 2048 foo/*error:NOT_ENOUGH_REQUIRED_ARGUMENTS*/(1);
2049 x = foo/*error:NOT_ENOUGH_REQUIRED_ARGUMENTS*/('1'); 2049 x = foo/*error:NOT_ENOUGH_REQUIRED_ARGUMENTS*/('1');
2050 x = /*error:COULD_NOT_INFER*/foo/*error:EXTRA_POSITIONAL_ARGUMENTS*/(/*error:A RGUMENT_TYPE_NOT_ASSIGNABLE*/1, /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/2, 3); 2050 x = foo/*error:EXTRA_POSITIONAL_ARGUMENTS*/(/*error:ARGUMENT_TYPE_NOT_ASSIGNAB LE*/1, /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/2, 3);
2051 x = /*error:COULD_NOT_INFER*/foo/*error:NOT_ENOUGH_REQUIRED_ARGUMENTS*/(/*erro r:ARGUMENT_TYPE_NOT_ASSIGNABLE*/1); 2051 x = foo/*error:NOT_ENOUGH_REQUIRED_ARGUMENTS*/(/*error:ARGUMENT_TYPE_NOT_ASSIG NABLE*/1);
2052 2052
2053 // named arguments 2053 // named arguments
2054 bar(y: 1, x: 2, /*error:UNDEFINED_NAMED_PARAMETER*/z: 3); 2054 bar(y: 1, x: 2, /*error:UNDEFINED_NAMED_PARAMETER*/z: 3);
2055 x = bar(/*error:UNDEFINED_NAMED_PARAMETER*/z: '1', x: '2', y: '3'); 2055 x = bar(/*error:UNDEFINED_NAMED_PARAMETER*/z: '1', x: '2', y: '3');
2056 bar(y: 1); 2056 bar(y: 1);
2057 x = bar(x: '1', /*error:UNDEFINED_NAMED_PARAMETER*/z: 42); 2057 x = bar(x: '1', /*error:UNDEFINED_NAMED_PARAMETER*/z: 42);
2058 x = /*error:COULD_NOT_INFER*/bar(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/y: 1, / *error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/x: 2, /*error:UNDEFINED_NAMED_PARAMETER*/z: 3); 2058 x = bar(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/y: 1, /*error:ARGUMENT_TYPE_NOT_ ASSIGNABLE*/x: 2, /*error:UNDEFINED_NAMED_PARAMETER*/z: 3);
2059 x = /*error:COULD_NOT_INFER*/bar(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/x: 1); 2059 x = bar(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/x: 1);
2060 } 2060 }
2061 '''); 2061 ''');
2062 } 2062 }
2063 2063
2064 test_genericMethodOverride() async { 2064 test_genericMethodOverride() async {
2065 await checkFile(''' 2065 await checkFile('''
2066 class Future<T> { 2066 class Future<T> {
2067 /*=S*/ then/*<S>*/(/*=S*/ onValue(T t)) => null; 2067 /*=S*/ then/*<S>*/(/*=S*/ onValue(T t)) => null;
2068 } 2068 }
2069 2069
(...skipping 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after
4138 class CheckerTest_Driver extends CheckerTest { 4138 class CheckerTest_Driver extends CheckerTest {
4139 @override 4139 @override
4140 bool get enableNewAnalysisDriver => true; 4140 bool get enableNewAnalysisDriver => true;
4141 4141
4142 @failingTest 4142 @failingTest
4143 @override 4143 @override
4144 test_covariantOverride_fields() async { 4144 test_covariantOverride_fields() async {
4145 await super.test_covariantOverride_fields(); 4145 await super.test_covariantOverride_fields();
4146 } 4146 }
4147 } 4147 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/strong_mode_test.dart ('k') | pkg/analyzer/test/src/task/strong/inferred_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698