diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2022-12-24 02:33:06 -0500 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2022-12-24 02:40:33 -0500 |
| commit | 6cd80042133c28d37bb30eba49d022a4fb23c058 (patch) | |
| tree | 145473c2257fc2d9ed6d8538e9304b286d64ccdf /src/Sema.zig | |
| parent | 0559cdb5542a2acb50ce49363c1973f3ca70365e (diff) | |
| download | zig-6cd80042133c28d37bb30eba49d022a4fb23c058.tar.gz zig-6cd80042133c28d37bb30eba49d022a4fb23c058.zip | |
Sema: relax undefined checks for concat
Closes #14037
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 216200d9d3..81da501d3c 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -12262,8 +12262,16 @@ fn zirArrayCat(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai break :p null; }; - const runtime_src = if (try sema.resolveDefinedValue(block, lhs_src, lhs)) |lhs_val| rs: { - if (try sema.resolveDefinedValue(block, rhs_src, rhs)) |rhs_val| { + const runtime_src = if (switch (lhs_ty.zigTypeTag()) { + .Array, .Struct => try sema.resolveMaybeUndefVal(lhs), + .Pointer => try sema.resolveDefinedValue(block, lhs_src, lhs), + else => unreachable, + }) |lhs_val| rs: { + if (switch (rhs_ty.zigTypeTag()) { + .Array, .Struct => try sema.resolveMaybeUndefVal(rhs), + .Pointer => try sema.resolveDefinedValue(block, rhs_src, rhs), + else => unreachable, + }) |rhs_val| { const lhs_sub_val = if (lhs_ty.isSinglePointer()) (try sema.pointerDeref(block, lhs_src, lhs_val, lhs_ty)).? else |
