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

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

Issue 2754423002: Fail inference when an instance field is referenced. (Closed)
Patch Set: Clean up and move tests. Created 3 years, 9 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
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 95529a727f10618cee9808be81fa437d8486b96c..6ba50b52c6479e35e54bbc1532eeb3ec2665f0c5 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -6936,21 +6936,9 @@ final v = c.items..[1] = 2;
isValidConst: false,
operators: [
UnlinkedExprOperation.pushReference,
- // ..[1] = 2
- UnlinkedExprOperation.cascadeSectionBegin,
- UnlinkedExprOperation.pushInt,
- UnlinkedExprOperation.pushInt,
- UnlinkedExprOperation.assignToIndex,
- // c
- UnlinkedExprOperation.cascadeSectionEnd,
- ],
- assignmentOperators: [
- UnlinkedExprAssignOperator.assign,
- ],
- ints: [
- 2,
- 1
],
+ assignmentOperators: [],
+ ints: [],
strings: [],
referenceValidators: [
(EntityRef r) => checkTypeRef(r, null, 'items',
@@ -6976,34 +6964,14 @@ final v = new C()..f1 = 1..f2 += 2;
assertUnlinkedConst(variable.initializer.bodyExpr,
isValidConst: false,
operators: [
- // new C()
UnlinkedExprOperation.invokeConstructor,
- // ..f1 = 1
- UnlinkedExprOperation.cascadeSectionBegin,
- UnlinkedExprOperation.pushInt,
- UnlinkedExprOperation.assignToProperty,
- // C
- UnlinkedExprOperation.cascadeSectionEnd,
- // ..f2 += 2
- UnlinkedExprOperation.cascadeSectionBegin,
- UnlinkedExprOperation.pushInt,
- UnlinkedExprOperation.assignToProperty,
- // C
- UnlinkedExprOperation.cascadeSectionEnd,
- ],
- assignmentOperators: [
- UnlinkedExprAssignOperator.assign,
- UnlinkedExprAssignOperator.plus,
],
+ assignmentOperators: [],
ints: [
- 0, 0, // new C()
- 1, // f1 = 1
- 2, // f2 += 2
- ],
- strings: [
- 'f1',
- 'f2',
+ 0,
+ 0
],
+ strings: [],
referenceValidators: [
(EntityRef r) => checkTypeRef(r, null, 'C',
expectedKind: ReferenceKind.classOrEnum)
@@ -7031,57 +6999,17 @@ final v = new A()
assertUnlinkedConst(variable.initializer.bodyExpr,
isValidConst: false,
operators: [
- // new A()
- UnlinkedExprOperation.invokeConstructor,
- // ..fa1 = 1
- UnlinkedExprOperation.cascadeSectionBegin,
- UnlinkedExprOperation.pushInt,
- UnlinkedExprOperation.assignToProperty,
- UnlinkedExprOperation.cascadeSectionEnd,
- // ..b
- UnlinkedExprOperation.cascadeSectionBegin,
- // new B()
UnlinkedExprOperation.invokeConstructor,
- // ..fb = 2
- UnlinkedExprOperation.cascadeSectionBegin,
- UnlinkedExprOperation.pushInt,
- UnlinkedExprOperation.assignToProperty,
- UnlinkedExprOperation.cascadeSectionEnd,
- // ..b = <pop value>
- UnlinkedExprOperation.assignToProperty,
- UnlinkedExprOperation.cascadeSectionEnd,
- // ..fa2 = 3
- UnlinkedExprOperation.cascadeSectionBegin,
- UnlinkedExprOperation.pushInt,
- UnlinkedExprOperation.assignToProperty,
- UnlinkedExprOperation.cascadeSectionEnd,
- ],
- assignmentOperators: [
- UnlinkedExprAssignOperator.assign,
- UnlinkedExprAssignOperator.assign,
- UnlinkedExprAssignOperator.assign,
- UnlinkedExprAssignOperator.assign,
],
+ assignmentOperators: [],
ints: [
0,
0,
- 1,
- 0,
- 0,
- 2,
- 3,
- ],
- strings: [
- 'fa1',
- 'fb',
- 'b',
- 'fa2',
],
+ strings: [],
referenceValidators: [
(EntityRef r) => checkTypeRef(r, null, 'A',
expectedKind: ReferenceKind.classOrEnum),
- (EntityRef r) => checkTypeRef(r, null, 'B',
- expectedKind: ReferenceKind.classOrEnum),
]);
}
@@ -7099,33 +7027,10 @@ final v = a..m(5).abs()..m(6);
assertUnlinkedConst(variable.initializer.bodyExpr,
isValidConst: false,
operators: [
- // a
UnlinkedExprOperation.pushReference,
- // ..m(5)
- UnlinkedExprOperation.cascadeSectionBegin,
- UnlinkedExprOperation.pushInt,
- UnlinkedExprOperation.invokeMethod,
- // ..abs()
- UnlinkedExprOperation.invokeMethod,
- // a
- UnlinkedExprOperation.cascadeSectionEnd,
- // ..m(6)
- UnlinkedExprOperation.cascadeSectionBegin,
- UnlinkedExprOperation.pushInt,
- UnlinkedExprOperation.invokeMethod,
- // a
- UnlinkedExprOperation.cascadeSectionEnd,
- ],
- ints: [
- 5, 0, 1, 0, // m(5)
- 0, 0, 0, // abs()
- 6, 0, 1, 0, // m(5)
- ],
- strings: [
- 'm',
- 'abs',
- 'm',
],
+ ints: [],
+ strings: [],
referenceValidators: [
(EntityRef r) => checkTypeRef(r, null, 'a',
expectedKind: ReferenceKind.topLevelPropertyAccessor),
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_common.dart ('k') | pkg/analyzer/test/src/summary/top_level_inference_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698