mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Removed builtin empty tuple type (#3021)
Co-authored-by: Farzana Ahmed Siddique <fasiddique@google.com> Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Farzana Ahmed Siddique
Jon Ross-Perkins
parent
1006956ed5
commit
db5e269097
@@ -3,6 +3,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
#include "toolchain/semantics/semantics_context.h"
|
||||
#include "toolchain/semantics/semantics_node.h"
|
||||
|
||||
namespace Carbon {
|
||||
|
||||
@@ -41,8 +42,14 @@ auto SemanticsHandleCallExpression(SemanticsContext& context,
|
||||
/*diagnostic=*/nullptr));
|
||||
|
||||
// TODO: Propagate return types from callable.
|
||||
SemanticsTypeId type_id = callable.return_type_id;
|
||||
// For functions with an implicit return type, set the return type to empty
|
||||
// tuple type.
|
||||
if (type_id == SemanticsTypeId::Invalid) {
|
||||
type_id = context.CanonicalizeTupleType(call_expr_parse_node, {});
|
||||
}
|
||||
auto call_node_id = context.AddNode(SemanticsNode::Call::Make(
|
||||
call_expr_parse_node, callable.return_type_id, refs_id, function_id));
|
||||
call_expr_parse_node, type_id, refs_id, function_id));
|
||||
|
||||
context.node_stack().Push(parse_node, call_node_id);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user