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

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

Issue 2978353002: Resynthesize field formal parameters from Kernel. (Closed)
Patch Set: Created 3 years, 5 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 38b9b1a5b3022b8e1c76632d090cae826a6fa7e0..5b633ec12026e3baf19e6ba92c582ac917a8e8b4 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_common.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_common.dart
@@ -1833,11 +1833,22 @@ class C {
var library =
await checkLibrary('class C { C(this.x); }', allowErrors: true);
if (isStrongMode) {
- checkElementText(library, r'''
+ if (isSharedFrontEnd) {
+ // Kernel does not store 'isFieldFormal' flag explicitly.
+ // We infer it from presence of the corresponding FieldInitializer.
+ // But if there is no field, there is no FieldInitializer.
+ checkElementText(library, r'''
+class C {
+ C(dynamic x);
+}
+''');
+ } else {
+ checkElementText(library, r'''
class C {
C(dynamic this.x);
}
''');
+ }
} else {
checkElementText(library, r'''
class C {
@@ -9803,7 +9814,7 @@ const dynamic a = null;
class C {
dynamic x;
C([@
- a/*location: test.dart;a?*/ dynamic this.x = null]);
+ a/*location: test.dart;a?*/ dynamic this.x]);
}
const dynamic a = null;
''');
@@ -9812,7 +9823,7 @@ const dynamic a = null;
class C {
dynamic x;
C([@
- a/*location: test.dart;a?*/ dynamic this.x = null]);
+ a/*location: test.dart;a?*/ dynamic this.x]);
}
const dynamic a = null;
''');
@@ -9913,13 +9924,13 @@ dynamic f(@
checkElementText(library, r'''
const dynamic a = null;
dynamic f([@
- a/*location: test.dart;a?*/ () → dynamic g = null]) {}
+ a/*location: test.dart;a?*/ () → dynamic g]) {}
''');
} else {
checkElementText(library, r'''
const dynamic a = null;
dynamic f([@
- a/*location: test.dart;a?*/ () → dynamic g = null]) {}
+ a/*location: test.dart;a?*/ () → dynamic g]) {}
''');
}
}
@@ -10155,13 +10166,13 @@ dynamic f(@
checkElementText(library, r'''
const dynamic a = null;
dynamic f([@
- a/*location: test.dart;a?*/ dynamic x = null]) {}
+ a/*location: test.dart;a?*/ dynamic x]) {}
''');
} else {
checkElementText(library, r'''
const dynamic a = null;
dynamic f([@
- a/*location: test.dart;a?*/ dynamic x = null]) {}
+ a/*location: test.dart;a?*/ dynamic x]) {}
''');
}
}

Powered by Google App Engine
This is Rietveld 408576698