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

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

Issue 2899073004: Use declared return type for inference of return and yield statements. (Closed)
Patch Set: Created 3 years, 7 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 42d3a59efa81f35d779ece3d562a0f71cce3c456..6a7bece2662e6ff4aebc8bf3d5203c08f06fd902 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -480,12 +480,11 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
}
@override
- void finishFunction(
- FormalParameters formals, AsyncMarker asyncModifier, Statement body) {
+ void finishFunction(FunctionNode function, FormalParameters formals,
+ AsyncMarker asyncModifier, Statement body) {
ahe 2017/05/24 16:00:21 You can access FunctionNode like this: member.tar
Paul Berry 2017/05/24 16:20:16 Yes, that worked! Thank you, that makes this CL m
debugEvent("finishFunction");
typePromoter.finished();
- // TODO(paulberry): get function return type from the outline.
- _typeInferrer.inferFunctionBody(null, asyncModifier, body);
+ _typeInferrer.inferFunctionBody(function.returnType, asyncModifier, body);
KernelFunctionBuilder builder = member;
builder.body = body;
if (formals?.optional != null) {

Powered by Google App Engine
This is Rietveld 408576698