| 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 cf12003c4e2b38d502ddbab0a31be4f228e4b15f..4d04fe21ffa9f00d2bea12d0fc3c34aefa420a43 100644
|
| --- a/pkg/analyzer/test/src/summary/summary_common.dart
|
| +++ b/pkg/analyzer/test/src/summary/summary_common.dart
|
| @@ -2459,6 +2459,59 @@ const v = p.C.m;
|
| ]);
|
| }
|
|
|
| + test_constExpr_pushReference_topLevelFunction() {
|
| + UnlinkedVariable variable = serializeVariableText('''
|
| +f() {}
|
| +const v = f;
|
| +''');
|
| + _assertUnlinkedConst(variable.constExpr, operators: [
|
| + UnlinkedConstOperation.pushReference
|
| + ], referenceValidators: [
|
| + (EntityRef r) => checkTypeRef(r, null, null, 'f',
|
| + expectedKind: ReferenceKind.topLevelFunction)
|
| + ]);
|
| + }
|
| +
|
| + test_constExpr_pushReference_topLevelFunction_imported() {
|
| + addNamedSource(
|
| + '/a.dart',
|
| + '''
|
| +f() {}
|
| +''');
|
| + UnlinkedVariable variable = serializeVariableText('''
|
| +import 'a.dart';
|
| +const v = f;
|
| +''');
|
| + _assertUnlinkedConst(variable.constExpr, operators: [
|
| + UnlinkedConstOperation.pushReference
|
| + ], referenceValidators: [
|
| + (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'f',
|
| + expectedKind: ReferenceKind.topLevelFunction)
|
| + ]);
|
| + }
|
| +
|
| + test_constExpr_pushReference_topLevelFunction_imported_withPrefix() {
|
| + addNamedSource(
|
| + '/a.dart',
|
| + '''
|
| +f() {}
|
| +''');
|
| + UnlinkedVariable variable = serializeVariableText('''
|
| +import 'a.dart' as p;
|
| +const v = p.f;
|
| +''');
|
| + _assertUnlinkedConst(variable.constExpr, operators: [
|
| + UnlinkedConstOperation.pushReference
|
| + ], referenceValidators: [
|
| + (EntityRef r) => checkTypeRef(r, absUri('/a.dart'), 'a.dart', 'f',
|
| + expectedKind: ReferenceKind.topLevelFunction,
|
| + prefixExpectations: [
|
| + new _PrefixExpectation(ReferenceKind.prefix, 'p',
|
| + inLibraryDefiningUnit: true)
|
| + ])
|
| + ]);
|
| + }
|
| +
|
| test_constExpr_pushReference_topLevelVariable() {
|
| UnlinkedVariable variable = serializeVariableText('''
|
| const int a = 1;
|
|
|