From 115c08956278b79c848e04c2f4eefca40e6cd8a3 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Sat, 20 May 2023 09:35:11 -0400 Subject: Value: add `intern` and `unintern` to facilitate code conversion This allows some code (like struct initializers) to use interned types while other code (such as comptime mutation) continues to use legacy types. With these changes, an `zig build-obj empty.zig` gets to a crash on missing interned error union types. --- src/Module.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Module.zig') diff --git a/src/Module.zig b/src/Module.zig index 70b08ea3a9..dc9b9402bd 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -5762,7 +5762,7 @@ pub fn analyzeFnBody(mod: *Module, func: *Fn, arena: Allocator) SemaError!Air { // Crucially, this happens *after* we set the function state to success above, // so that dependencies on the function body will now be satisfied rather than // result in circular dependency errors. - sema.resolveFnTypes(fn_ty_info) catch |err| switch (err) { + sema.resolveFnTypes(mod.typeToFunc(fn_ty).?) catch |err| switch (err) { error.NeededSourceLocation => unreachable, error.GenericPoison => unreachable, error.ComptimeReturn => unreachable, -- cgit v1.2.3