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

Unified Diff: pkg/analyzer/test/src/summary/resynthesize_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/resynthesize_common.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_common.dart b/pkg/analyzer/test/src/summary/resynthesize_common.dart
index f5ce02425ac67b2ab1549814cd80f9624176266e..561a43011d7da77c9131bb3c11e04c4ac3ae7275 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_common.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_common.dart
@@ -440,6 +440,8 @@ abstract class AbstractResynthesizeTest extends AbstractSingleUnitTest {
checkElidablePrefix(oTarget.prefix);
checkElidablePrefix(oTarget.identifier);
compareConstAsts(r, o.propertyName, desc);
+ } else if (o is SuperExpression && r is SuperExpression) {
+ // Nothing to compare.
} else if (o is ThisExpression && r is ThisExpression) {
// Nothing to compare.
} else if (o is NullLiteral) {
@@ -695,6 +697,10 @@ abstract class AbstractResynthesizeTest extends AbstractSingleUnitTest {
// Validate modifiers.
for (Modifier modifier in Modifier.values) {
+ // There is no way to know this by looking at declarations.
+ if (modifier == Modifier.REFERENCES_SUPER) {
Paul Berry 2017/01/29 14:28:02 We can't safely do this. The modifier REFERENCES_
scheglov 2017/01/29 18:05:15 Done.
+ continue;
+ }
bool got = _hasModifier(resynthesized, modifier);
bool want = _hasModifier(original, modifier);
expect(got, want,
@@ -2362,6 +2368,12 @@ const vComplement = ~1;
''');
}
+ test_const_topLevel_super() {
+ checkLibrary(r'''
+const vSuper = super;
+''');
+ }
+
test_const_topLevel_this() {
checkLibrary(r'''
const vThis = this;
@@ -4820,6 +4832,19 @@ typedef F();''');
checkLibrary('f() {} g() {}');
}
+ test_unresolved_annotation_instanceCreation_argument_super() {
+ checkLibrary(
+ '''
+class A {
+ const A(_);
+}
+
+@A(super)
+class C {}
+''',
+ allowErrors: true);
+ }
+
test_unresolved_annotation_instanceCreation_argument_this() {
checkLibrary(
'''
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_const_expr.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698