| ... | @@ -7026,9 +7026,14 @@ fn funcCommon( | ... | @@ -7026,9 +7026,14 @@ fn funcCommon( |
| 7026 | }); | 7026 | }); |
| 7027 | }; | 7027 | }; |
| 7028 | | 7028 | |
| 7029 | // stage1 bug workaround | 7029 | // These locals are pulled out from the init expression below to work around |
| 7030 | const cc_workaround = cc orelse undefined; | 7030 | // a stage1 compiler bug. |
| 7031 | const align_workaround = alignment orelse @as(u32, undefined); | 7031 | // In the case of generic calling convention, or generic alignment, we use |
| | 7032 | // default values which are only meaningful for the generic function, *not* |
| | 7033 | // the instantiation, which can depend on comptime parameters. |
| | 7034 | // Related proposal: https://github.com/ziglang/zig/issues/11834 |
| | 7035 | const cc_workaround = cc orelse .Unspecified; |
| | 7036 | const align_workaround = alignment orelse 0; |
| 7032 | | 7037 | |
| 7033 | break :fn_ty try Type.Tag.function.create(sema.arena, .{ | 7038 | break :fn_ty try Type.Tag.function.create(sema.arena, .{ |
| 7034 | .param_types = param_types, | 7039 | .param_types = param_types, |