| Index: pkg/analyzer/test/src/summary/summary_test.dart
|
| diff --git a/pkg/analyzer/test/src/summary/summary_test.dart b/pkg/analyzer/test/src/summary/summary_test.dart
|
| index 41692ab1fd7fbd628539443b956b49c0bea51251..3d8d0623887c8fa40749346cf861949ee905e94d 100644
|
| --- a/pkg/analyzer/test/src/summary/summary_test.dart
|
| +++ b/pkg/analyzer/test/src/summary/summary_test.dart
|
| @@ -582,11 +582,15 @@ abstract class SummaryTest {
|
| * type.
|
| */
|
| void checkUnresolvedTypeRef(
|
| - TypeRef typeRef, String expectedPrefix, String expectedName) {
|
| + TypeRef typeRef, String expectedPrefix, String expectedName,
|
| + {LinkedUnit linkedSourceUnit, UnlinkedUnit unlinkedSourceUnit}) {
|
| // When serializing from the element model, unresolved type refs lose their
|
| // name.
|
| checkTypeRef(typeRef, null, null, checkAstDerivedData ? expectedName : null,
|
| - expectedPrefix: expectedPrefix, expectedKind: ReferenceKind.unresolved);
|
| + expectedPrefix: expectedPrefix,
|
| + expectedKind: ReferenceKind.unresolved,
|
| + linkedSourceUnit: linkedSourceUnit,
|
| + unlinkedSourceUnit: unlinkedSourceUnit);
|
| }
|
|
|
| fail_constExpr_pushInt_shiftOr() {
|
| @@ -3909,6 +3913,21 @@ typedef F();''';
|
| expect(type.typeParameters[1].name, 'U');
|
| }
|
|
|
| + test_unresolved_reference_in_multiple_parts() {
|
| + addNamedSource('/a.dart', 'part of foo; int x; Unresolved y;');
|
| + serializeLibraryText('library foo; part "a.dart"; Unresolved z;',
|
| + allowErrors: true);
|
| + // The unresolved types in the defining compilation unit and the part
|
| + // should both work correctly even though they use different reference
|
| + // indices.
|
| + checkUnresolvedTypeRef(
|
| + unlinkedUnits[0].variables[0].type, null, 'Unresolved');
|
| + checkUnresolvedTypeRef(
|
| + unlinkedUnits[1].variables[1].type, null, 'Unresolved',
|
| + linkedSourceUnit: linked.units[1],
|
| + unlinkedSourceUnit: unlinkedUnits[1]);
|
| + }
|
| +
|
| test_variable() {
|
| String text = 'int i;';
|
| UnlinkedVariable v = serializeVariableText(text, variableName: 'i');
|
|
|