diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-03-31 15:39:04 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-03-31 15:39:04 -0700 |
| commit | abd06d8eab508319e5f7839c802f4a81d80a0025 (patch) | |
| tree | 4c718b756e129b76477e1fa850343cfe8c9191cb /src/Sema.zig | |
| parent | e272c29c163538159eb81f60cb5da3d7ebe099f9 (diff) | |
| download | zig-abd06d8eab508319e5f7839c802f4a81d80a0025.tar.gz zig-abd06d8eab508319e5f7839c802f4a81d80a0025.zip | |
stage2: clean up RangeSet and fix swapped Sema switch logic for lhs/rhs
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index e702a058dd..6af8cd7b9a 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -2888,7 +2888,7 @@ fn validateSwitchRange( // because we only have the switch AST node. Only if we know for sure we need to report // a compile error do we resolve the full source locations. const first_val = val: { - if (last.value()) |val| { + if (first.value()) |val| { if (val.isUndef()) { const src = switch_prong_src.resolve(block.src_decl, src_node_offset, .first); return sema.failWithUseOfUndef(block, src); @@ -2899,7 +2899,7 @@ fn validateSwitchRange( return sema.failWithNeededComptime(block, src); }; const last_val = val: { - if (first.value()) |val| { + if (last.value()) |val| { if (val.isUndef()) { const src = switch_prong_src.resolve(block.src_decl, src_node_offset, .last); return sema.failWithUseOfUndef(block, src); |
