commit 0958ea339129f9ed8c9c07c2c3fbb34fc758b62f (tree)
parent 71a9b35c0f853a4af49470f83763578eb4cf06e0
Author: Andrew Kelley <andrew@ziglang.org>
Date: Mon, 21 Jul 2025 15:45:17 -0700
Sema: fix missed slice access OPV
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/Sema.zig b/src/Sema.zig
@@ -28582,6 +28582,10 @@ fn elemValSlice(
}
}
+ if (try sema.typeHasOnePossibleValue(elem_ty)) |elem_only_value| {
+ return Air.internedToRef(elem_only_value.toIntern());
+ }
+
try sema.validateRuntimeElemAccess(block, elem_index_src, elem_ty, slice_ty, slice_src);
try sema.validateRuntimeValue(block, slice_src, slice);