diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2024-08-18 13:35:35 +0100 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2024-08-18 18:10:59 +0100 |
| commit | 93a5bd262defe4c09a617a4ecc68340e20a2b20b (patch) | |
| tree | 1f369ba5818e47ffc6ac4f0a68ff274568e591bf /src/Zcu/PerThread.zig | |
| parent | 10455371416a37da201b6f968d47ffae597ea7ce (diff) | |
| download | zig-93a5bd262defe4c09a617a4ecc68340e20a2b20b.tar.gz zig-93a5bd262defe4c09a617a4ecc68340e20a2b20b.zip | |
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.
Diffstat (limited to 'src/Zcu/PerThread.zig')
| -rw-r--r-- | src/Zcu/PerThread.zig | 5 |
1 files changed, 4 insertions, 1 deletions
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)); |
