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

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

Issue 1711173002: Substitute `dynamic` for type parameters when inferring types for JS(...) (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/static_type_analyzer.dart
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index 4a2362f7558f8eee6c78c44139bf845d6d7ce445..8ec251bef4edfbcaca5b1e11583da322bd94de0d 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -1600,6 +1600,12 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
}
ClassElement returnType = library.getType(elementName);
if (returnType != null) {
+ if (returnType.typeParameters.isNotEmpty) {
+ // Caller can't deal with unbound type parameters, so substitute
+ // `dynamic`.
+ return returnType.type.substitute4(
+ returnType.typeParameters.map((_) => _dynamicType).toList());
+ }
return returnType.type;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698