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

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

Issue 1758913002: Add instantiate method on ParameterizedType and InterfaceType. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments 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
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 b54bc044281de597b25840e5121c061511869256..86ce8301533440ca7045760c2413f134f912392b 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -641,7 +641,7 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
}
}
_recordStaticType(
- node, _typeProvider.listType.substitute4(<DartType>[staticType]));
+ node, _typeProvider.listType.instantiate(<DartType>[staticType]));
return null;
}
@@ -697,7 +697,7 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
_recordStaticType(
node,
_typeProvider.mapType
- .substitute4(<DartType>[staticKeyType, staticValueType]));
+ .instantiate(<DartType>[staticKeyType, staticValueType]));
return null;
}
@@ -787,7 +787,7 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
if (returnType != null) {
// prepare the type of the returned Future
InterfaceType newFutureType = _typeProvider.futureType
- .substitute4([returnType.flattenFutures(_typeSystem)]);
+ .instantiate([returnType.flattenFutures(_typeSystem)]);
// set the 'then' invocation type
_resolver.recordPropagatedTypeIfBetter(node, newFutureType);
needPropagatedType = false;
@@ -1485,10 +1485,10 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
InterfaceType genericType = body.isAsynchronous
? _typeProvider.streamType
: _typeProvider.iterableType;
- return genericType.substitute4(<DartType>[type]);
+ return genericType.instantiate(<DartType>[type]);
} else if (body.isAsynchronous) {
return _typeProvider.futureType
- .substitute4(<DartType>[type.flattenFutures(_typeSystem)]);
+ .instantiate(<DartType>[type.flattenFutures(_typeSystem)]);
} else {
return type;
}
@@ -1604,7 +1604,7 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
if (returnType.typeParameters.isNotEmpty) {
// Caller can't deal with unbound type parameters, so substitute
// `dynamic`.
- return returnType.type.substitute4(
+ return returnType.type.instantiate(
returnType.typeParameters.map((_) => _dynamicType).toList());
}
return returnType.type;
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/lib/src/generated/testing/element_factory.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698