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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2823243002: Introduce initial plumbing for type inference in fasta. (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/front_end/lib/src/fasta/kernel/body_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index ca3b4ed4d07b3e91a73e354240ccfffbb98c2c34..fbfee6bad2ffb6202c1fd4150741e3840c887a64 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -11,6 +11,12 @@ import '../parser/parser.dart' show FormalParameterType, optional;
import '../parser/identifier_context.dart' show IdentifierContext;
+import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart'
ahe 2017/04/18 15:49:59 Make relative?
Paul Berry 2017/04/18 16:33:17 I actually prefer absolute imports, and I was hopi
+ show KernelVariableDeclaration;
+
+import 'package:front_end/src/fasta/type_inference/type_inferrer.dart'
+ show TypeInferrer;
+
import 'package:kernel/ast.dart';
import 'package:kernel/clone.dart' show CloneVisitor;
@@ -79,6 +85,9 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
@override
final Uri uri;
+ final TypeInferrer<Statement, Expression, KernelVariableDeclaration, Field>
+ _typeInferrer;
ahe 2017/04/18 15:49:59 I prefer to keep things public unless implementing
Paul Berry 2017/04/18 16:33:17 Heh, I prefer the reverse. Let's talk about this
+
Scope formalParameterScope;
bool inInitializer = false;
@@ -112,7 +121,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
this.coreTypes,
this.classBuilder,
this.isInstanceMember,
- this.uri)
+ this.uri,
+ this._typeInferrer)
: enclosingScope = scope,
library = library,
isDartLibrary = library.uri.scheme == "dart",
@@ -423,6 +433,7 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
} else {
internalError("Unhandled: ${builder.runtimeType}");
}
+ _typeInferrer.inferBody(body, uri);
builder.body = body;
if (formals?.optional != null) {
Iterator<FormalParameterBuilder> formalBuilders =

Powered by Google App Engine
This is Rietveld 408576698