diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-08-11 12:00:32 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-08-11 12:01:02 -0400 |
| commit | 1b83ee78a48a64bef28f12b7b2e263074f88b6b6 (patch) | |
| tree | 14e7cfb300a16966bc562892c5051ea48020ab64 /src | |
| parent | 4bd4c5e06d13c35a70d0207b730fb67b83ff6363 (diff) | |
| download | zig-1b83ee78a48a64bef28f12b7b2e263074f88b6b6.tar.gz zig-1b83ee78a48a64bef28f12b7b2e263074f88b6b6.zip | |
allow comptime_int to implicit cast to comptime_float
Diffstat (limited to 'src')
| -rw-r--r-- | src/ir.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 2b096a3383..13348d28c4 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -9713,6 +9713,9 @@ static bool ir_num_lit_fits_in_other_type(IrAnalyze *ira, IrInstruction *instruc bool const_val_is_float = (const_val->type->id == ZigTypeIdFloat || const_val->type->id == ZigTypeIdComptimeFloat); assert(const_val_is_int || const_val_is_float); + if (const_val_is_int && other_type->id == ZigTypeIdComptimeFloat) { + return true; + } if (other_type->id == ZigTypeIdFloat) { if (const_val->type->id == ZigTypeIdComptimeInt || const_val->type->id == ZigTypeIdComptimeFloat) { return true; |
