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

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

Issue 1854213002: Add support for serializing 'target[index]' expressions. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/lib/src/summary/summarize_const_expr.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 ff519764d9f9bc080aa2123fefc7b9a4cb9cd855..e096754364f56db62e413b7a29adfcc0657f9e3c 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -5886,6 +5886,33 @@ final v = new C().f;
]);
}
+ test_expr_extractIndex_ofClassField() {
+ if (skipNonConstInitializers) {
+ return;
+ }
+ UnlinkedVariable variable = serializeVariableText('''
+class C {
+ List<int> get items => null;
+}
+final v = new C().items[5];
+''');
+ _assertUnlinkedConst(variable.constExpr, operators: [
+ UnlinkedConstOperation.invokeConstructor,
+ UnlinkedConstOperation.extractProperty,
+ UnlinkedConstOperation.pushInt,
+ UnlinkedConstOperation.extractIndex,
+ ], ints: [
+ 0,
+ 0,
+ 5
+ ], strings: [
+ 'items'
+ ], referenceValidators: [
+ (EntityRef r) => checkTypeRef(r, null, null, 'C',
+ expectedKind: ReferenceKind.classOrEnum)
+ ]);
+ }
+
test_field() {
UnlinkedClass cls = serializeClassText('class C { int i; }');
UnlinkedVariable variable = findVariable('i', variables: cls.fields);
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_const_expr.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698