mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
parent
01dba1c054
commit
3e084d8de3
2 changed files with 12 additions and 1 deletions
|
|
@ -24477,7 +24477,7 @@ fn coerceExtra(
|
|||
return block.addBitCast(dest_ty, inst);
|
||||
}
|
||||
|
||||
const is_undef = if (maybe_inst_val) |val| val.isUndef() else false;
|
||||
const is_undef = inst_ty.zigTypeTag() == .Undefined;
|
||||
|
||||
switch (dest_ty.zigTypeTag()) {
|
||||
.Optional => optional: {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
pub export fn entry() void {
|
||||
const x: []u8 = undefined;
|
||||
const y: f32 = x;
|
||||
_ = y;
|
||||
}
|
||||
|
||||
// error
|
||||
// backend=stage2
|
||||
// target=native
|
||||
//
|
||||
// :3:20: error: expected type 'f32', found '[]u8'
|
||||
Loading…
Add table
Reference in a new issue