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

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: Simpler implementation 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
« no previous file with comments | « pkg/analyzer/test/src/context/mock_sdk.dart ('k') | pkg/front_end/test/fasta/kompile.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..94eebead4e1172bf77eeb90187f64731cbb05412 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -484,8 +484,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
FormalParameters formals, AsyncMarker asyncModifier, Statement body) {
debugEvent("finishFunction");
typePromoter.finished();
- // TODO(paulberry): get function return type from the outline.
- _typeInferrer.inferFunctionBody(null, asyncModifier, body);
+ _typeInferrer.inferFunctionBody(
+ member.target.function.returnType, asyncModifier, body);
KernelFunctionBuilder builder = member;
builder.body = body;
if (formals?.optional != null) {
« no previous file with comments | « pkg/analyzer/test/src/context/mock_sdk.dart ('k') | pkg/front_end/test/fasta/kompile.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698