This commit is contained in:
Veikka Tuominen
2022-08-16 16:17:56 +03:00
committed by Andrew Kelley
parent 07f64a2e13
commit 59b6483d63
2 changed files with 32 additions and 9 deletions

View File

@@ -0,0 +1,24 @@
export fn entry1() void {
var f: f32 = 54.0 / 5;
_ = f;
}
export fn entry2() void {
var f: f32 = 54 / 5.0;
_ = f;
}
export fn entry3() void {
var f: f32 = 55.0 / 5;
_ = f;
}
export fn entry4() void {
var f: f32 = 55 / 5.0;
_ = f;
}
// error
// backend=stage2
// target=native
//
// :2:23: error: ambiguous coercion of division operands 'comptime_float' and 'comptime_int'; division has non-zero reminder '4'
// :6:21: error: ambiguous coercion of division operands 'comptime_int' and 'comptime_float'; division has non-zero reminder '4'