| Index: pkg/analyzer/test/src/summary/summary_common.dart
|
| diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart
|
| index ecacfe5de588e699616885e0840e3574ad13a2d5..5e2f084a858189de7f3dd0751212ee6dea90f964 100644
|
| --- a/pkg/analyzer/test/src/summary/summary_common.dart
|
| +++ b/pkg/analyzer/test/src/summary/summary_common.dart
|
| @@ -594,6 +594,7 @@ abstract class SummaryTest {
|
| : expectation.relativeUri ?? relativeUri,
|
| expectation.name,
|
| expectedKind: expectation.kind,
|
| + checkAstDerivedDataOverride: checkAstDerivedDataOverride,
|
| expectedTargetUnit: expectedTargetUnit,
|
| linkedSourceUnit: linkedSourceUnit,
|
| unlinkedSourceUnit: unlinkedSourceUnit,
|
| @@ -1969,6 +1970,123 @@ const v = const p.C();
|
| ]);
|
| }
|
|
|
| + test_constExpr_invokeConstructor_unresolved_named() {
|
| + UnlinkedVariable variable = serializeVariableText(
|
| + '''
|
| +class C {}
|
| +const v = const C.foo();
|
| +''',
|
| + allowErrors: true);
|
| + _assertUnlinkedConst(variable.constExpr, operators: [
|
| + UnlinkedConstOperation.invokeConstructor,
|
| + ], ints: [
|
| + 0,
|
| + 0
|
| + ], referenceValidators: [
|
| + (EntityRef r) => checkTypeRef(r, null, null, 'foo',
|
| + expectedKind: ReferenceKind.unresolved,
|
| + checkAstDerivedDataOverride: true,
|
| + prefixExpectations: [
|
| + new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
|
| + ])
|
| + ]);
|
| + }
|
| +
|
| + test_constExpr_invokeConstructor_unresolved_named2() {
|
| + UnlinkedVariable variable = serializeVariableText(
|
| + '''
|
| +const v = const C.foo();
|
| +''',
|
| + allowErrors: true);
|
| + _assertUnlinkedConst(variable.constExpr, operators: [
|
| + UnlinkedConstOperation.invokeConstructor,
|
| + ], ints: [
|
| + 0,
|
| + 0
|
| + ], referenceValidators: [
|
| + (EntityRef r) => checkTypeRef(r, null, null, 'foo',
|
| + expectedKind: ReferenceKind.unresolved,
|
| + checkAstDerivedDataOverride: true,
|
| + prefixExpectations: [
|
| + new _PrefixExpectation(ReferenceKind.unresolved, 'C')
|
| + ])
|
| + ]);
|
| + }
|
| +
|
| + test_constExpr_invokeConstructor_unresolved_named_prefixed() {
|
| + addNamedSource(
|
| + '/a.dart',
|
| + '''
|
| +class C {
|
| +}
|
| +''');
|
| + UnlinkedVariable variable = serializeVariableText(
|
| + '''
|
| +import 'a.dart' as p;
|
| +const v = const p.C.foo();
|
| +''',
|
| + allowErrors: true);
|
| + _assertUnlinkedConst(variable.constExpr, operators: [
|
| + UnlinkedConstOperation.invokeConstructor,
|
| + ], ints: [
|
| + 0,
|
| + 0
|
| + ], referenceValidators: [
|
| + (EntityRef r) => checkTypeRef(r, null, null, 'foo',
|
| + expectedKind: ReferenceKind.unresolved,
|
| + checkAstDerivedDataOverride: true,
|
| + prefixExpectations: [
|
| + new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
|
| + absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart'),
|
| + new _PrefixExpectation(ReferenceKind.prefix, 'p',
|
| + inLibraryDefiningUnit: true)
|
| + ])
|
| + ]);
|
| + }
|
| +
|
| + test_constExpr_invokeConstructor_unresolved_named_prefixed2() {
|
| + addNamedSource('/a.dart', '');
|
| + UnlinkedVariable variable = serializeVariableText(
|
| + '''
|
| +import 'a.dart' as p;
|
| +const v = const p.C.foo();
|
| +''',
|
| + allowErrors: true);
|
| + _assertUnlinkedConst(variable.constExpr, operators: [
|
| + UnlinkedConstOperation.invokeConstructor,
|
| + ], ints: [
|
| + 0,
|
| + 0
|
| + ], referenceValidators: [
|
| + (EntityRef r) => checkTypeRef(r, null, null, 'foo',
|
| + expectedKind: ReferenceKind.unresolved,
|
| + checkAstDerivedDataOverride: true,
|
| + prefixExpectations: [
|
| + new _PrefixExpectation(ReferenceKind.unresolved, 'C'),
|
| + new _PrefixExpectation(ReferenceKind.prefix, 'p',
|
| + inLibraryDefiningUnit: true)
|
| + ])
|
| + ]);
|
| + }
|
| +
|
| + test_constExpr_invokeConstructor_unresolved_unnamed() {
|
| + UnlinkedVariable variable = serializeVariableText(
|
| + '''
|
| +const v = const Foo();
|
| +''',
|
| + allowErrors: true);
|
| + _assertUnlinkedConst(variable.constExpr, operators: [
|
| + UnlinkedConstOperation.invokeConstructor,
|
| + ], ints: [
|
| + 0,
|
| + 0
|
| + ], referenceValidators: [
|
| + (EntityRef r) => checkTypeRef(r, null, null, 'Foo',
|
| + expectedKind: ReferenceKind.unresolved,
|
| + checkAstDerivedDataOverride: true)
|
| + ]);
|
| + }
|
| +
|
| test_constExpr_length_classConstField() {
|
| UnlinkedVariable variable = serializeVariableText('''
|
| class C {
|
|
|