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

Unified Diff: pkg/analyzer/lib/src/task/strong/checker.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
« no previous file with comments | « pkg/analyzer/lib/src/summary/summary_sdk.dart ('k') | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/strong/checker.dart
diff --git a/pkg/analyzer/lib/src/task/strong/checker.dart b/pkg/analyzer/lib/src/task/strong/checker.dart
index 8f0c9defbe4c4ba77b03e48983abe0d27e77d988..9831fb67ca9a59b79fcc1490f6dae3b952eff307 100644
--- a/pkg/analyzer/lib/src/task/strong/checker.dart
+++ b/pkg/analyzer/lib/src/task/strong/checker.dart
@@ -337,7 +337,7 @@ class CodeChecker extends RecursiveAstVisitor {
: node.loopVariable?.identifier;
if (loopVariable != null) {
var iteratorType = loopVariable.staticType;
- var checkedType = iterableType.substitute4([iteratorType]);
+ var checkedType = iterableType.instantiate([iteratorType]);
checkAssignment(expr, checkedType);
}
node.visitChildren(this);
@@ -648,7 +648,7 @@ class CodeChecker extends RecursiveAstVisitor {
!body.isGenerator &&
actualType is InterfaceType &&
actualType.element == futureType.element) {
- type = futureType.substitute4([type]);
+ type = futureType.instantiate([type]);
}
// TODO(vsm): Enforce void or dynamic (to void?) when expression is null.
if (expression != null) checkAssignment(expression, type);
@@ -753,7 +753,7 @@ class CodeChecker extends RecursiveAstVisitor {
if (yieldStar) {
if (type.isDynamic) {
// Ensure it's at least a Stream / Iterable.
- return expectedType.substitute4([typeProvider.dynamicType]);
+ return expectedType.instantiate([typeProvider.dynamicType]);
} else {
// Analyzer will provide a separate error if expected type
// is not compatible with type.
« no previous file with comments | « pkg/analyzer/lib/src/summary/summary_sdk.dart ('k') | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698