Commit 3e0a46281c

Andrew Kelley <andrew@ziglang.org>
2020-07-28 02:38:18
stage2: fix function calls always having void return type
1 parent 1c2e65f
Changed files (1)
src-self-hosted
src-self-hosted/Module.zig
@@ -2828,8 +2828,10 @@ fn analyzeInstCall(self: *Module, scope: *Scope, inst: *zir.Inst.Call) InnerErro
         casted_args[i] = try self.coerce(scope, fn_param_types[i], uncasted_arg);
     }
 
+    const ret_type = func.ty.fnReturnType();
+
     const b = try self.requireRuntimeBlock(scope, inst.base.src);
-    return self.addCall(b, inst.base.src, Type.initTag(.void), func, casted_args);
+    return self.addCall(b, inst.base.src, ret_type, func, casted_args);
 }
 
 fn analyzeInstFn(self: *Module, scope: *Scope, fn_inst: *zir.Inst.Fn) InnerError!*Inst {