turn assertion into compile error for using var as return type

closes #758
This commit is contained in:
Andrew Kelley
2018-03-06 20:41:49 -05:00
parent eff3530dfa
commit 6b5cfd9d99
2 changed files with 14 additions and 11 deletions

View File

@@ -12019,7 +12019,7 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal
inst_fn_type_id.alignment = align_bytes;
}
{
if (fn_proto_node->data.fn_proto.return_var_token == nullptr) {
AstNode *return_type_node = fn_proto_node->data.fn_proto.return_type;
TypeTableEntry *specified_return_type = analyze_type_expr(ira->codegen, impl_fn->child_scope, return_type_node);
if (type_is_invalid(specified_return_type))