aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/ambiguous_coercion_of_division_operands.zig
blob: 06562454bfa3cc76b80fab50b745b7744db48fbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
export fn entry1() void {
    const f: f32 = 54.0 / 5;
    _ = f;
}
export fn entry2() void {
    const f: f32 = 54 / 5.0;
    _ = f;
}
export fn entry3() void {
    const f: f32 = 55.0 / 5;
    _ = f;
}
export fn entry4() void {
    const f: f32 = 55 / 5.0;
    _ = f;
}

// error
//
// :2:25: error: ambiguous coercion of division operands 'comptime_float' and 'comptime_int'; non-zero remainder '4'
// :6:23: error: ambiguous coercion of division operands 'comptime_int' and 'comptime_float'; non-zero remainder '4'