aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-10-21 23:01:05 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-10-21 23:01:05 -0700
commit895aea0b630df97edbbcf68bfad251968c9b9fbf (patch)
tree8ff1152e5f318976d9835c15cc40c0ef66131243 /src
parent0a6851cc6de540ed95c3ec1c78eb3da7897bd930 (diff)
downloadzig-895aea0b630df97edbbcf68bfad251968c9b9fbf.tar.gz
zig-895aea0b630df97edbbcf68bfad251968c9b9fbf.zip
Sema: fix type checking of `@intToFloat` operands
There was a typo and they were backwards.
Diffstat (limited to 'src')
-rw-r--r--src/Sema.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 6f430655ca..71689f65d9 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -9561,8 +9561,8 @@ fn zirIntToFloat(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!
const operand = sema.resolveInst(extra.rhs);
const operand_ty = sema.typeOf(operand);
- _ = try sema.checkIntType(block, ty_src, dest_ty);
- try sema.checkFloatType(block, operand_src, operand_ty);
+ try sema.checkFloatType(block, ty_src, dest_ty);
+ _ = try sema.checkIntType(block, operand_src, operand_ty);
if (try sema.resolveMaybeUndefVal(block, operand_src, operand)) |val| {
const target = sema.mod.getTarget();