From 93a5bd262defe4c09a617a4ecc68340e20a2b20b Mon Sep 17 00:00:00 2001 From: mlugg Date: Sun, 18 Aug 2024 13:35:35 +0100 Subject: 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. --- src/Zcu/PerThread.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Zcu/PerThread.zig') diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig index 700d8708b1..88bc318b3c 100644 --- a/src/Zcu/PerThread.zig +++ b/src/Zcu/PerThread.zig @@ -2072,6 +2072,9 @@ fn analyzeFnBody(pt: Zcu.PerThread, func_index: InternPool.Index) Zcu.SemaError! errdefer _ = zcu.analysis_in_progress.swapRemove(anal_unit); func.setAnalysisState(ip, .analyzed); + if (func.analysisUnordered(ip).inferred_error_set) { + func.setResolvedErrorSet(ip, .none); + } // This is the `Cau` corresponding to the `declaration` instruction which the function or its generic owner originates from. const decl_cau = ip.getCau(cau: { @@ -2278,7 +2281,7 @@ fn analyzeFnBody(pt: Zcu.PerThread, func_index: InternPool.Index) Zcu.SemaError! else => |e| return e, }; assert(ies.resolved != .none); - ip.funcSetIesResolved(func_index, ies.resolved); + func.setResolvedErrorSet(ip, ies.resolved); } assert(zcu.analysis_in_progress.swapRemove(anal_unit)); -- cgit v1.2.3