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 507f21c8133b31c3883dc98923bbcf7fbfccd8ec..99f2340a4c1b29e52282b052513723bc81333277 100644 |
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart |
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart |
@@ -2432,10 +2432,14 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper { |
FunctionNode function = pop(); |
exitLocalScope(); |
var declaration = pop(); |
- var returnType = pop() ?? const DynamicType(); |
+ var returnType = pop(); |
+ var hasImplicitReturnType = returnType == null; |
+ returnType ??= const DynamicType(); |
pop(); // Modifiers. |
exitFunction(); |
if (declaration is FunctionDeclaration) { |
+ KernelFunctionDeclaration.setHasImplicitReturnType( |
+ declaration, hasImplicitReturnType); |
function.returnType = returnType; |
declaration.variable.type = function.functionType; |
declaration.function = function; |