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

Unified Diff: pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart

Issue 1881013002: Expand ResolvedAst to handle synthetic constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments + fix test, cps and compilation units for injected members. Created 4 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/compiler/lib/src/inferrer/simple_types_inferrer.dart
diff --git a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
index e3b2327c6269666c676c7f1581b94995412d7b9e..70aa4be8d11c19b899fa1f4215efd162f4945f0b 100644
--- a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
@@ -339,16 +339,24 @@ class SimpleTypeInferrerVisitor<T>
final Setlet<Entity> capturedVariables = new Setlet<Entity>();
SimpleTypeInferrerVisitor.internal(
- analyzedElement, this.outermostElement, inferrer, compiler, locals)
- : super(analyzedElement, inferrer, inferrer.types, compiler, locals),
+ AstElement analyzedElement,
+ ResolvedAst resolvedAst,
+ this.outermostElement,
+ inferrer,
+ compiler,
+ locals)
+ : super(analyzedElement, resolvedAst, inferrer, inferrer.types, compiler,
+ locals),
this.inferrer = inferrer {
assert(outermostElement != null);
}
- SimpleTypeInferrerVisitor(Element element, Compiler compiler,
- InferrerEngine<T, TypeSystem<T>> inferrer, [LocalsHandler<T> handler])
+ SimpleTypeInferrerVisitor(Element element, ResolvedAst resolvedAst,
+ Compiler compiler, InferrerEngine<T, TypeSystem<T>> inferrer,
+ [LocalsHandler<T> handler])
: this.internal(
element,
+ resolvedAst,
element.outermostEnclosingMemberOrTopLevel.implementation,
inferrer,
compiler,
@@ -375,8 +383,8 @@ class SimpleTypeInferrerVisitor<T>
// be handled specially, in that we are computing their LUB at
// each update, and reading them yields the type that was found in a
// previous analysis of [outermostElement].
- ClosureClassMap closureData = compiler.closureToClassMapper
- .computeClosureToClassMapping(analyzedElement, node, elements);
+ ClosureClassMap closureData =
+ compiler.closureToClassMapper.computeClosureToClassMapping(resolvedAst);
closureData.forEachCapturedVariable((variable, field) {
locals.setCaptured(variable, field);
});
@@ -402,8 +410,8 @@ class SimpleTypeInferrerVisitor<T>
SimpleTypeInferrerVisitor visitor = this;
if (inferrer.hasAlreadyComputedTypeOfParameterDefault(element)) return;
if (element.functionDeclaration != analyzedElement) {
- visitor = new SimpleTypeInferrerVisitor(
- element.functionDeclaration, compiler, inferrer);
+ visitor = new SimpleTypeInferrerVisitor(element.functionDeclaration,
+ element.functionDeclaration.resolvedAst, compiler, inferrer);
}
T type =
(defaultValue == null) ? types.nullType : visitor.visit(defaultValue);
@@ -552,7 +560,7 @@ class SimpleTypeInferrerVisitor<T>
LocalsHandler closureLocals =
new LocalsHandler<T>.from(locals, node, useOtherTryBlock: false);
SimpleTypeInferrerVisitor visitor = new SimpleTypeInferrerVisitor<T>(
- element, compiler, inferrer, closureLocals);
+ element, element.resolvedAst, compiler, inferrer, closureLocals);
visitor.run();
inferrer.recordReturnType(element, visitor.returnType);
« no previous file with comments | « pkg/compiler/lib/src/inferrer/inferrer_visitor.dart ('k') | pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698