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.
This commit is contained in:
Jacob Young authored and Andrew Kelley committed 2023-06-10 20:47:53 -07:00
1 parent be78a12d7d
commit 115c089562
6 files changed
+604 -178

No files matched your search

+1 -1
View File
@@ -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,