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

This is finishing #678
This commit is contained in:
Jon Meow authored and GitHub committed 2021-08-06 15:18:39 -07:00
1 parent 4b2346cfcd
commit 6164cdfd6d
13 files changed
+133 -60

No files matched your search

+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: