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

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart

Issue 2958363002: Adjust return types of spec-mode function expressions to match VM. (Closed)
Patch Set: Created 3 years, 6 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/type_inference/type_inferrer.dart
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index e5ae7cd8268d4410f31266ef6bce8c811bb80c3c..0c3eb3f8d260353390f626b0ad70ea491ba750f1 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -660,7 +660,7 @@ abstract class TypeInferrerImpl extends TypeInferrer {
}
DartType inferLocalFunction(FunctionNode function, DartType typeContext,
- bool typeNeeded, int fileOffset, DartType returnContext, bool isNamed) {
+ bool typeNeeded, int fileOffset, DartType returnContext) {
bool hasImplicitReturnType = returnContext == null;
if (!isTopLevel) {
for (var parameter in function.positionalParameters) {
@@ -758,8 +758,7 @@ abstract class TypeInferrerImpl extends TypeInferrer {
// Apply type inference to `B` in return context `N’`, with any references
// to `xi` in `B` having type `Pi`. This produces `B’`.
bool isExpressionFunction = function.body is ReturnStatement;
- bool needToSetReturnType = hasImplicitReturnType &&
- ((isExpressionFunction && !isNamed) || strongMode);
+ bool needToSetReturnType = hasImplicitReturnType && strongMode;
ClosureContext oldClosureContext = this.closureContext;
ClosureContext closureContext =
new ClosureContext(this, function.asyncMarker, returnContext);

Powered by Google App Engine
This is Rietveld 408576698