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

Unified Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 2827463002: Issue 29360. Fix type name resolution for GenericTypeAliasElement. (Closed)
Patch Set: Created 3 years, 8 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/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index d6e8567944d1db1a5597fe8e6ed37ac7cf0ecd80..0bc4a8869f64f219158b4393571aa33c42bb1c92 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -8419,9 +8419,17 @@ class TypeNameResolver {
typeArguments[i] = dynamicType;
}
}
- type = typeSystem.instantiateType(type, typeArguments);
+ if (element is GenericTypeAliasElementImpl) {
+ type = element.typeAfterSubstitution(typeArguments) ?? dynamicType;
+ } else {
+ type = typeSystem.instantiateType(type, typeArguments);
+ }
} else {
- type = typeSystem.instantiateToBounds(type);
+ if (element is GenericTypeAliasElementImpl) {
+ type = element.typeAfterSubstitution(null) ?? dynamicType;
+ } else {
+ type = typeSystem.instantiateToBounds(type);
+ }
}
typeName.staticType = type;
node.type = type;
@@ -8486,7 +8494,7 @@ class TypeNameResolver {
typeArguments[i] = _getType(arguments[i]);
}
}
- return element.typeAfterSubstitution(typeArguments);
+ return element.typeAfterSubstitution(typeArguments) ?? dynamicType;
}
}
return type;
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/test/generated/non_error_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698