| 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 ea8bb99c4fddc0da859f3cf5ac8056c77471d7c7..8ba2965814a16b5b17ba2535cff8f111a7c086bc 100644
|
| --- a/pkg/analyzer/test/src/summary/summary_common.dart
|
| +++ b/pkg/analyzer/test/src/summary/summary_common.dart
|
| @@ -2415,6 +2415,24 @@ const v = p.C.F;
|
| ]);
|
| }
|
|
|
| + test_constExpr_pushReference_field_simpleIdentifier() {
|
| + UnlinkedVariable variable = serializeClassText('''
|
| +class C {
|
| + static const a = b;
|
| + static const b = null;
|
| +}
|
| +''').fields[0];
|
| + _assertUnlinkedConst(variable.constExpr, operators: [
|
| + UnlinkedConstOperation.pushReference
|
| + ], referenceValidators: [
|
| + (EntityRef r) => checkTypeRef(r, null, null, 'b',
|
| + expectedKind: ReferenceKind.propertyAccessor,
|
| + prefixExpectations: [
|
| + new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
|
| + ])
|
| + ]);
|
| + }
|
| +
|
| test_constExpr_pushReference_staticMethod() {
|
| UnlinkedVariable variable = serializeVariableText('''
|
| class C {
|
| @@ -2483,6 +2501,24 @@ const v = p.C.m;
|
| ]);
|
| }
|
|
|
| + test_constExpr_pushReference_staticMethod_simpleIdentifier() {
|
| + UnlinkedVariable variable = serializeClassText('''
|
| +class C {
|
| + static const a = m;
|
| + static m() {}
|
| +}
|
| +''').fields[0];
|
| + _assertUnlinkedConst(variable.constExpr, operators: [
|
| + UnlinkedConstOperation.pushReference
|
| + ], referenceValidators: [
|
| + (EntityRef r) => checkTypeRef(r, null, null, 'm',
|
| + expectedKind: ReferenceKind.method,
|
| + prefixExpectations: [
|
| + new _PrefixExpectation(ReferenceKind.classOrEnum, 'C')
|
| + ])
|
| + ]);
|
| + }
|
| +
|
| test_constExpr_pushReference_topLevelFunction() {
|
| UnlinkedVariable variable = serializeVariableText('''
|
| f() {}
|
| @@ -2580,6 +2616,19 @@ const v = p.a;
|
| ]);
|
| }
|
|
|
| + test_constExpr_pushReference_typeParameter() {
|
| + String text = '''
|
| +class C<T> {
|
| + static const a = T;
|
| +}
|
| +''';
|
| + UnlinkedVariable variable = serializeClassText(
|
| + text,
|
| + allowErrors: true)
|
| + .fields[0];
|
| + _assertUnlinkedConst(variable.constExpr, isInvalid: true);
|
| + }
|
| +
|
| test_constExpr_pushString_adjacent() {
|
| UnlinkedVariable variable =
|
| serializeVariableText('const v = "aaa" "b" "ccc";');
|
|
|