mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 15:21:04 +01:00
Verify that provision/omission of return types matches (#717)
This is finishing #678
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user