| ... | @@ -8277,8 +8277,21 @@ fn zirParam( | ... | @@ -8277,8 +8277,21 @@ fn zirParam( |
| 8277 | else => |e| return e, | 8277 | else => |e| return e, |
| 8278 | } | 8278 | } |
| 8279 | }; | 8279 | }; |
| 8280 | const is_comptime = comptime_syntax or | 8280 | const is_comptime = sema.typeRequiresComptime(param_ty) catch |err| switch (err) { |
| 8281 | try sema.typeRequiresComptime(param_ty); | 8281 | error.GenericPoison => { |
| | 8282 | // The type is not available until the generic instantiation. |
| | 8283 | // We result the param instruction with a poison value and |
| | 8284 | // insert an anytype parameter. |
| | 8285 | try block.params.append(sema.gpa, .{ |
| | 8286 | .ty = Type.initTag(.generic_poison), |
| | 8287 | .is_comptime = comptime_syntax, |
| | 8288 | .name = param_name, |
| | 8289 | }); |
| | 8290 | try sema.inst_map.putNoClobber(sema.gpa, inst, .generic_poison); |
| | 8291 | return; |
| | 8292 | }, |
| | 8293 | else => |e| return e, |
| | 8294 | } or comptime_syntax; |
| 8282 | if (sema.inst_map.get(inst)) |arg| { | 8295 | if (sema.inst_map.get(inst)) |arg| { |
| 8283 | if (is_comptime) { | 8296 | if (is_comptime) { |
| 8284 | // We have a comptime value for this parameter so it should be elided from the | 8297 | // We have a comptime value for this parameter so it should be elided from the |