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

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

Issue 2244043002: Fix instantiateToBounds behavior in summary resynthesizer to match that of StrongTypeSystemImpl.ins… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | « no previous file | pkg/analyzer/test/src/summary/resynthesize_strong_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/resynthesize.dart
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
index 26068ac20e53ae391ff79e6ad7fcfd37421b2578..2df51d4c8d8b4ae6cff8f05ff7fbf1b558aa3c3a 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -1285,14 +1285,23 @@ class _ReferenceInfo {
InterfaceTypeImpl type =
new InterfaceTypeImpl.elementWithNameAndArgs(element, name, () {
if (typeArguments == null) {
- typeArguments = element.typeParameters.map((typeParameter) {
- DartType bound = typeParameter.bound;
- return libraryResynthesizer.summaryResynthesizer.strongMode &&
- instantiateToBoundsAllowed &&
- bound != null
- ? bound
- : DynamicTypeImpl.instance;
- }).toList();
+ typeArguments = element.typeParameters
+ .map/*<DartType>*/((_) => DynamicTypeImpl.instance)
+ .toList();
+ if (libraryResynthesizer.summaryResynthesizer.strongMode &&
+ instantiateToBoundsAllowed) {
+ List<DartType> typeParameterTypes;
+ for (int i = 0; i < typeArguments.length; i++) {
+ DartType bound = element.typeParameters[i].bound;
+ if (bound != null) {
+ typeParameterTypes ??= element.typeParameters
+ .map/*<DartType>*/((TypeParameterElement e) => e.type)
+ .toList();
+ typeArguments[i] =
+ bound.substitute2(typeArguments, typeParameterTypes);
+ }
+ }
+ }
}
return typeArguments;
});
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_strong_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698