| author | |
| committer | |
| log | 02619edf413cd3b8b01a6a3514ecd257d7c08b6e |
| tree | b27dffca9c3c26ef8cb33776dfbdf1941e7f6e55 |
| parent | 2e1bdd0d14f490a80bbed3ee0e0479a908715d33 |
This reverts commit 2e1bdd0d14f490a80bbed3ee0e0479a908715d33.
Test failures2 files changed, 1 insertions(+), 14 deletions(-)
src/ir.cpp+1-1| ... | ... | @@ -26718,7 +26718,7 @@ static IrInstGen *ir_analyze_instruction_float_cast(IrAnalyze *ira, IrInstSrcFlo |
| 26718 | 26718 | } |
| 26719 | 26719 | |
| 26720 | 26720 | if (instr_is_comptime(target) || dest_type->id == ZigTypeIdComptimeFloat) { |
| 26721 | return ir_analyze_widen_or_shorten(ira, &instruction->target->base, target, dest_type); | |
| 26721 | return ir_implicit_cast2(ira, &instruction->target->base, target, dest_type); | |
| 26722 | 26722 | } |
| 26723 | 26723 | |
| 26724 | 26724 | if (target->value->type->id != ZigTypeIdFloat) { |
test/stage1/behavior/cast.zig-13| ... | ... | @@ -384,19 +384,6 @@ test "@intCast i32 to u7" { |
| 384 | 384 | expect(z == 0xff); |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | test "@floatCast cast down" { | |
| 388 | { | |
| 389 | var double: f64 = 0.001534; | |
| 390 | var single = @floatCast(f32, double); | |
| 391 | expect(@TypeOf(single) == f32); | |
| 392 | } | |
| 393 | { | |
| 394 | const double: f64 = 0.001534; | |
| 395 | const single = @floatCast(f32, double); | |
| 396 | expect(@TypeOf(single) == f32); | |
| 397 | } | |
| 398 | } | |
| 399 | ||
| 400 | 387 | test "implicit cast undefined to optional" { |
| 401 | 388 | expect(MakeType(void).getNull() == null); |
| 402 | 389 | expect(MakeType(void).getNonNull() != null); |