aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-08-18 13:35:35 +0100
committermlugg <mlugg@mlugg.co.uk>2024-08-18 18:10:59 +0100
commit93a5bd262defe4c09a617a4ecc68340e20a2b20b (patch)
tree1f369ba5818e47ffc6ac4f0a68ff274568e591bf /src/Sema.zig
parent10455371416a37da201b6f968d47ffae597ea7ce (diff)
downloadzig-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/Sema.zig')
-rw-r--r--src/Sema.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 7930c8f080..756e0ac9ca 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -32527,6 +32527,7 @@ fn analyzeIsNonErrComptimeOnly(
// If the error set is empty, we must return a comptime true or false.
// However we want to avoid unnecessarily resolving an inferred error set
// in case it is already non-empty.
+ try mod.maybeUnresolveIes(func_index);
switch (ip.funcIesResolvedUnordered(func_index)) {
.anyerror_type => break :blk,
.none => {},
@@ -33596,6 +33597,7 @@ fn wrapErrorUnionSet(
.inferred_error_set_type => |func_index| ok: {
// We carefully do this in an order that avoids unnecessarily
// resolving the destination error set type.
+ try mod.maybeUnresolveIes(func_index);
switch (ip.funcIesResolvedUnordered(func_index)) {
.anyerror_type => break :ok,
.none => if (.ok == try sema.coerceInMemoryAllowedErrorSets(block, dest_err_set_ty, inst_ty, inst_src, inst_src)) {
@@ -35853,8 +35855,7 @@ fn resolveInferredErrorSet(
try sema.declareDependency(.{ .interned = func_index }); // resolved IES
- // TODO: during an incremental update this might not be `.none`, but the
- // function might be out-of-date!
+ try zcu.maybeUnresolveIes(func_index);
const resolved_ty = func.resolvedErrorSetUnordered(ip);
if (resolved_ty != .none) return resolved_ty;