Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1222)

Unified Diff: pkg/analyzer/test/src/summary/summary_common.dart

Issue 1675393002: Fix summarization of unqualified references to class members. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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";');
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698