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

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

Issue 2661803002: Issue 28491. Add support for UnlinkedExprOperation.pushSuper even though it is not allowed. (Closed)
Patch Set: Created 3 years, 11 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 44785cc525fc63593408ed8fd6a57fe39027fd1e..3dd4f0c8ce2fa8e9cf61745ce5427eef17698f15 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -7709,6 +7709,18 @@ final v = f<int, String>();
]);
}
+ test_expr_super() {
+ if (skipNonConstInitializers) {
+ return;
+ }
+ UnlinkedVariable variable = serializeVariableText('''
+final v = super;
+''');
+ assertUnlinkedConst(variable.initializer.bodyExpr, operators: [
+ UnlinkedExprOperation.pushSuper,
+ ]);
+ }
+
test_expr_this() {
if (skipNonConstInitializers) {
return;
@@ -9204,6 +9216,28 @@ D d;''');
checkAnnotationA(unlinkedUnits[0].imports[0].annotations);
}
+ test_metadata_invalid_instanceCreation_argument_super() {
+ List<UnlinkedExpr> annotations = serializeClassText('''
+class A {
+ const A(_);
+}
+
+@A(super)
+class C {}
+''').annotations;
+ expect(annotations, hasLength(1));
+ assertUnlinkedConst(annotations[0], operators: [
+ UnlinkedExprOperation.pushSuper,
+ UnlinkedExprOperation.invokeConstructor,
+ ], ints: [
+ 0,
+ 1
+ ], referenceValidators: [
+ (EntityRef r) => checkTypeRef(r, null, null, 'A',
+ expectedKind: ReferenceKind.classOrEnum)
+ ]);
+ }
+
test_metadata_invalid_instanceCreation_argument_this() {
List<UnlinkedExpr> annotations = serializeClassText('''
class A {

Powered by Google App Engine
This is Rietveld 408576698