Verify that provision/omission of return types matches (#717)

This is finishing #678
This commit is contained in:
Jon Meow
2021-08-06 15:18:39 -07:00
committed by GitHub
parent 4b2346cfcd
commit 6164cdfd6d
13 changed files with 133 additions and 60 deletions
+3 -1
View File
@@ -510,10 +510,12 @@ function_definition:
}
| FN identifier deduced_params maybe_empty_tuple_pattern DBLARROW expression ";"
{
// The return type is not considered "omitted" because it's automatic from
// the expression.
$$ = FunctionDefinition(
yylineno, $2, $3, $4,
global_arena->New<AutoPattern>(yylineno), true,
Statement::MakeReturn(yylineno, $6, false));
Statement::MakeReturn(yylineno, $6, true));
}
;
function_declaration: