From 6b5cfd9d9963d2f1e91dfdb40f26c2ad11beb3c4 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 6 Mar 2018 20:41:49 -0500 Subject: turn assertion into compile error for using var as return type closes #758 --- src/ir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 6fc1322c30..c52ab7388f 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -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)) -- cgit v1.2.3