| Index: pkg/analyzer/test/src/task/strong/inferred_type_test.dart
|
| diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
|
| index 300b4715cbfc9c3800ef6d059b5ed1e98a480ab2..3999671270f5b694f02137de59fa94c151a1d7a6 100644
|
| --- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
|
| +++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
|
| @@ -1840,6 +1840,46 @@ test1() {
|
| ''');
|
| }
|
|
|
| + void test_inferGenericMethodType_named() {
|
| + var unit = checkFile('''
|
| +class C {
|
| + /*=T*/ m/*<T>*/(int a, {String b, /*=T*/ c}) => null;
|
| +}
|
| +var y = new C().m(1, b: 'bbb', c: 2.0);
|
| + ''');
|
| + expect(unit.topLevelVariables[0].type.toString(), 'double');
|
| + }
|
| +
|
| + void test_inferGenericMethodType_positional() {
|
| + var unit = checkFile('''
|
| +class C {
|
| + /*=T*/ m/*<T>*/(int a, [/*=T*/ b]) => null;
|
| +}
|
| +var y = new C().m(1, 2.0);
|
| + ''');
|
| + expect(unit.topLevelVariables[0].type.toString(), 'double');
|
| + }
|
| +
|
| + void test_inferGenericMethodType_positional2() {
|
| + var unit = checkFile('''
|
| +class C {
|
| + /*=T*/ m/*<T>*/(int a, [String b, /*=T*/ c]) => null;
|
| +}
|
| +var y = new C().m(1, 'bbb', 2.0);
|
| + ''');
|
| + expect(unit.topLevelVariables[0].type.toString(), 'double');
|
| + }
|
| +
|
| + void test_inferGenericMethodType_required() {
|
| + var unit = checkFile('''
|
| +class C {
|
| + /*=T*/ m/*<T>*/(/*=T*/ x) => x;
|
| +}
|
| +var y = new C().m(42);
|
| + ''');
|
| + expect(unit.topLevelVariables[0].type.toString(), 'int');
|
| + }
|
| +
|
| void test_inferIfComplexExpressionsReadPossibleInferredField() {
|
| // but flags can enable this behavior.
|
| addFile(
|
|
|