| 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 a6867401c46e215cccf90efd503112723a0e5bcb..45e0ada2bb86505783aa9b49f400845c1c2493d0 100644
|
| --- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
|
| +++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
|
| @@ -479,6 +479,32 @@ test1() {
|
| ''');
|
| }
|
|
|
| + void test_circularReference_viaClosures() {
|
| + var mainUnit = checkFile('''
|
| +var x = () => y;
|
| +var y = () => x;
|
| +''');
|
| + var x = mainUnit.topLevelVariables[0];
|
| + var y = mainUnit.topLevelVariables[1];
|
| + expect(x.name, 'x');
|
| + expect(y.name, 'y');
|
| + expect(x.type.toString(), 'dynamic');
|
| + expect(y.type.toString(), 'dynamic');
|
| + }
|
| +
|
| + void test_circularReference_viaClosures_initializerTypes() {
|
| + var mainUnit = checkFile('''
|
| +var x = () => y;
|
| +var y = () => x;
|
| +''');
|
| + var x = mainUnit.topLevelVariables[0];
|
| + var y = mainUnit.topLevelVariables[1];
|
| + expect(x.name, 'x');
|
| + expect(y.name, 'y');
|
| + expect(x.initializer.returnType.toString(), '() → dynamic');
|
| + expect(y.initializer.returnType.toString(), '() → dynamic');
|
| + }
|
| +
|
| void test_conflictsCanHappen() {
|
| checkFile('''
|
| class I1 {
|
| @@ -2551,25 +2577,24 @@ final x = <String, F<int>>{};
|
| expect(x.type.toString(), 'Map<String, () → int>');
|
| }
|
|
|
| - void test_inferredType_opAssignToProperty_prefixedIdentifier() {
|
| + void test_inferredType_opAssignToProperty() {
|
| var mainUnit = checkFile('''
|
| class C {
|
| num n;
|
| }
|
| -C c;
|
| -var x = (c.n *= null);
|
| +C f() => null;
|
| +var x = (f().n *= null);
|
| ''');
|
| - var x = mainUnit.topLevelVariables[1];
|
| + var x = mainUnit.topLevelVariables[0];
|
| expect(x.name, 'x');
|
| expect(x.type.toString(), 'num');
|
| }
|
|
|
| - void test_inferredType_opAssignToProperty_prefixedIdentifier_viaInterface() {
|
| + void test_inferredType_opAssignToProperty_prefixedIdentifier() {
|
| var mainUnit = checkFile('''
|
| -class I {
|
| +class C {
|
| num n;
|
| }
|
| -abstract class C implements I {}
|
| C c;
|
| var x = (c.n *= null);
|
| ''');
|
| @@ -2578,15 +2603,16 @@ var x = (c.n *= null);
|
| expect(x.type.toString(), 'num');
|
| }
|
|
|
| - void test_inferredType_opAssignToProperty() {
|
| + void test_inferredType_opAssignToProperty_prefixedIdentifier_viaInterface() {
|
| var mainUnit = checkFile('''
|
| -class C {
|
| +class I {
|
| num n;
|
| }
|
| -C f() => null;
|
| -var x = (f().n *= null);
|
| +abstract class C implements I {}
|
| +C c;
|
| +var x = (c.n *= null);
|
| ''');
|
| - var x = mainUnit.topLevelVariables[0];
|
| + var x = mainUnit.topLevelVariables[1];
|
| expect(x.name, 'x');
|
| expect(x.type.toString(), 'num');
|
| }
|
|
|