diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-03-29 16:56:12 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-03-29 16:56:12 -0700 |
| commit | b59428e9f78b1f9f265c0ffdba79b128d77644d2 (patch) | |
| tree | c6a9a066eee45fc5ca3009e3b8bcf1f219adbd83 /src | |
| parent | 12e1304805cbe132d17b31bac2e8123869007e4d (diff) | |
| download | zig-b59428e9f78b1f9f265c0ffdba79b128d77644d2.tar.gz zig-b59428e9f78b1f9f265c0ffdba79b128d77644d2.zip | |
Sema: adjust coercion of undefined error union payload
To no longer set the error code to undefined. This fixes the problem
where an undefined single-item pointer coerced to an error union of a
slice set the whole thing to undefined even though the sub-coercion to
the slice would have produced a defined value.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Sema.zig | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index afb97f3b3d..09f99c5751 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -18140,11 +18140,6 @@ fn coerce( return sema.addConstUndef(dest_ty); }, else => { - // undefined sets the error code also to undefined. - if (is_undef) { - return sema.addConstUndef(dest_ty); - } - // T to E!T return sema.wrapErrorUnionPayload(block, dest_ty, inst, inst_src); }, |
