| 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 70f2b8a80fb1813289f9bcfc8103afc2e3d0795c..314cc4d3be2d9ee0b7d91580b0fbf8306da3edca 100644
|
| --- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
|
| +++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
|
| @@ -2937,6 +2937,20 @@ final x = C.d.i;
|
| expect(x.type.toString(), 'int');
|
| }
|
|
|
| + void test_referenceToFieldOfStaticGetter() {
|
| + var mainUnit = checkFile('''
|
| +class C {
|
| + static D get d => null;
|
| +}
|
| +class D {
|
| + int i;
|
| +}
|
| +final x = C.d.i;
|
| +''');
|
| + var x = mainUnit.topLevelVariables[0];
|
| + expect(x.type.toString(), 'int');
|
| + }
|
| +
|
| void test_staticRefersToNonStaticField_inOtherLibraryCycle() {
|
| addFile(
|
| '''
|
| @@ -2988,22 +3002,6 @@ test() {
|
| ''');
|
| }
|
|
|
| - void test_typeInferenceDependency_topLevelVariable_inIdentifierSequence() {
|
| - // Check that type inference dependencies are properly checked when a top
|
| - // level variable appears at the beginning of a string of identifiers
|
| - // separated by '.'.
|
| - var mainUnit = checkFile('''
|
| -final a = /*info:DYNAMIC_INVOKE*/c.i;
|
| -final c = new C(a);
|
| -class C {
|
| - C(_);
|
| - int i;
|
| -}
|
| -''');
|
| - // No type should be inferred for a because there is a circular reference
|
| - // between a and c.
|
| - }
|
| -
|
| void test_typeInferenceDependency_staticVariable_inIdentifierSequence() {
|
| // Check that type inference dependencies are properly checked when a static
|
| // variable appears in the middle of a string of identifiers separated by
|
| @@ -3023,6 +3021,22 @@ class D {
|
| var a = mainUnit.topLevelVariables[0];
|
| expect(a.type.toString(), 'dynamic');
|
| }
|
| +
|
| + void test_typeInferenceDependency_topLevelVariable_inIdentifierSequence() {
|
| + // Check that type inference dependencies are properly checked when a top
|
| + // level variable appears at the beginning of a string of identifiers
|
| + // separated by '.'.
|
| + var mainUnit = checkFile('''
|
| +final a = /*info:DYNAMIC_INVOKE*/c.i;
|
| +final c = new C(a);
|
| +class C {
|
| + C(_);
|
| + int i;
|
| +}
|
| +''');
|
| + // No type should be inferred for a because there is a circular reference
|
| + // between a and c.
|
| + }
|
| }
|
|
|
| @reflectiveTest
|
|
|