| ... | @@ -15966,8 +15966,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai | ... | @@ -15966,8 +15966,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 15966 | } })).toValue()), | 15966 | } })).toValue()), |
| 15967 | .Fn => { | 15967 | .Fn => { |
| 15968 | // TODO: look into memoizing this result. | 15968 | // TODO: look into memoizing this result. |
| 15969 | const info = mod.typeToFunc(ty).?; | | |
| 15970 | | | |
| 15971 | var params_anon_decl = try block.startAnonDecl(); | 15969 | var params_anon_decl = try block.startAnonDecl(); |
| 15972 | defer params_anon_decl.deinit(); | 15970 | defer params_anon_decl.deinit(); |
| 15973 | | 15971 | |
| ... | @@ -15993,8 +15991,10 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai | ... | @@ -15993,8 +15991,10 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 15993 | const param_info_decl = mod.declPtr(param_info_decl_index); | 15991 | const param_info_decl = mod.declPtr(param_info_decl_index); |
| 15994 | const param_info_ty = param_info_decl.val.toType(); | 15992 | const param_info_ty = param_info_decl.val.toType(); |
| 15995 | | 15993 | |
| 15996 | const param_vals = try sema.arena.alloc(InternPool.Index, info.param_types.len); | 15994 | const param_vals = try sema.arena.alloc(InternPool.Index, mod.typeToFunc(ty).?.param_types.len); |
| 15997 | for (param_vals, info.param_types, 0..) |*param_val, param_ty, i| { | 15995 | for (param_vals, 0..) |*param_val, i| { |
| | 15996 | const info = mod.typeToFunc(ty).?; |
| | 15997 | const param_ty = info.param_types[i]; |
| 15998 | const is_generic = param_ty == .generic_poison_type; | 15998 | const is_generic = param_ty == .generic_poison_type; |
| 15999 | const param_ty_val = try mod.intern_pool.get(gpa, .{ .opt = .{ | 15999 | const param_ty_val = try mod.intern_pool.get(gpa, .{ .opt = .{ |
| 16000 | .ty = try mod.intern_pool.get(gpa, .{ .opt_type = .type_type }), | 16000 | .ty = try mod.intern_pool.get(gpa, .{ .opt_type = .type_type }), |
| ... | @@ -16046,6 +16046,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai | ... | @@ -16046,6 +16046,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 16046 | } }); | 16046 | } }); |
| 16047 | }; | 16047 | }; |
| 16048 | | 16048 | |
| | 16049 | const info = mod.typeToFunc(ty).?; |
| 16049 | const ret_ty_opt = try mod.intern(.{ .opt = .{ | 16050 | const ret_ty_opt = try mod.intern(.{ .opt = .{ |
| 16050 | .ty = try mod.intern_pool.get(gpa, .{ .opt_type = .type_type }), | 16051 | .ty = try mod.intern_pool.get(gpa, .{ .opt_type = .type_type }), |
| 16051 | .val = if (info.return_type == .generic_poison_type) .none else info.return_type, | 16052 | .val = if (info.return_type == .generic_poison_type) .none else info.return_type, |