Chromium Code Reviews| 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 ad5a7b144b1ee177a3e3402a8434085a9b179046..56355cca0747d5e17ae61fa4d91c181cb9b42fb2 100644 |
| --- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart |
| +++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart |
| @@ -2987,6 +2987,42 @@ 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 strong of identifiers |
|
scheglov
2016/05/03 23:35:16
"string of identifiers"
Paul Berry
2016/05/04 01:45:28
Done.
|
| + // 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 |
| + // '.'. |
| + var mainUnit = checkFile(''' |
| +final a = /*info:DYNAMIC_INVOKE*/C.d.i; |
| +class C { |
| + static final d = new D(a); |
| +} |
| +class D { |
| + D(_); |
| + int i; |
| +} |
| +'''); |
| + // No type should be inferred for a because there is a circular reference |
| + // between a and C.d. |
| + var a = mainUnit.topLevelVariables[0]; |
| + expect(a.type.toString(), 'dynamic'); |
| + } |
| } |
| @reflectiveTest |