Commit 49e19fc94f

So1aric <51471119+So1aric@users.noreply.github.com>
2025-11-12 20:21:28
Sema: fix inline fn compiler crash (#25586)
Resolves: https://github.com/ziglang/zig/issues/25581
1 parent be2a902
Changed files (2)
src
test
src/Sema.zig
@@ -25528,9 +25528,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
         extra_index += 1;
         if (extra.data.bits.ret_ty_is_generic) break :blk .generic_poison;
 
-        const ret_ty_air_ref = try sema.resolveInst(ret_ty_ref);
-        const ret_ty_val = try sema.resolveConstDefinedValue(block, ret_src, ret_ty_air_ref, .{ .simple = .function_ret_ty });
-        break :blk ret_ty_val.toType();
+        break :blk try sema.resolveType(block, ret_src, ret_ty_ref);
     } else .void;
 
     const noalias_bits: u32 = if (extra.data.bits.has_any_noalias) blk: {
test/cases/compile_errors/value_as_inline_fn_return_type.zig
@@ -0,0 +1,11 @@
+inline fn a() null {
+    return null;
+}
+
+pub fn main() void {
+    _ = a();
+}
+
+// error
+//
+// :1:15: error: expected type 'type', found '@TypeOf(null)'