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

Unified Diff: pkg/analyzer/lib/src/summary/link.dart

Issue 2994913002: Fix for inheriting covariance from a resynthesyzed parameter. (Closed)
Patch Set: Created 3 years, 4 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/dart/analysis/driver.dart ('k') | pkg/analyzer/test/src/summary/linker_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/link.dart
diff --git a/pkg/analyzer/lib/src/summary/link.dart b/pkg/analyzer/lib/src/summary/link.dart
index fe9d6b13ee2fbd1448acd9fe5e3d78d2a017add0..2b2f5857d17f5dbf98c94611e02baaa4ded193ca 100644
--- a/pkg/analyzer/lib/src/summary/link.dart
+++ b/pkg/analyzer/lib/src/summary/link.dart
@@ -1434,6 +1434,11 @@ class CompilationUnitElementInDependency extends CompilationUnitElementForLink {
@override
final LinkedUnit _linkedUnit;
+ /**
+ * Set of slot ids corresponding to parameters that inherit `covariant`.
+ */
+ Set<int> parametersInheritingCovariant;
+
List<EntityRef> _linkedTypeRefs;
@override
@@ -1448,6 +1453,8 @@ class CompilationUnitElementInDependency extends CompilationUnitElementForLink {
: _linkedUnit = linkedUnit,
super(
unlinkedUnit, unitNum, linkedUnit.references.length, absoluteUri) {
+ parametersInheritingCovariant =
+ _linkedUnit.parametersInheritingCovariant.toSet();
// Make one pass through the linked types to determine the lengths for
// _linkedTypeRefs and _linkedTypes. TODO(paulberry): add an int to the
// summary to make this unnecessary.
@@ -4297,6 +4304,12 @@ class ParameterElementForLink implements ParameterElementImpl {
if (_unlinkedParam.initializer?.bodyExpr != null) {
_constNode = new ConstParameterNode(this);
}
+ if (compilationUnit is CompilationUnitElementInDependency) {
+ _inheritsCovariant =
+ (compilationUnit as CompilationUnitElementInDependency)
+ .parametersInheritingCovariant
+ .contains(_unlinkedParam.inheritsCovariantSlot);
+ }
}
factory ParameterElementForLink.forFactory(
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/driver.dart ('k') | pkg/analyzer/test/src/summary/linker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698