frontend: removed resolved IES data for outdated functions

Without this, incremental updates which would change inferred error sets
fail, since they assume the IES is resolved and equals the old set,
resulting in false positive compile errors when e.g. coercing to an IES.
This commit is contained in:
mlugg
2024-08-18 13:35:35 +01:00
parent 1045537141
commit 93a5bd262d
4 changed files with 41 additions and 3 deletions

View File

@@ -2160,6 +2160,14 @@ pub const Key = union(enum) {
pub fn resolvedErrorSetUnordered(func: Func, ip: *const InternPool) Index {
return @atomicLoad(Index, func.resolvedErrorSetPtr(@constCast(ip)), .unordered);
}
pub fn setResolvedErrorSet(func: Func, ip: *InternPool, ies: Index) void {
const extra_mutex = &ip.getLocal(func.tid).mutate.extra.mutex;
extra_mutex.lock();
defer extra_mutex.unlock();
@atomicStore(Index, func.resolvedErrorSetPtr(ip), ies, .release);
}
};
pub const Int = struct {