mirror of
https://github.com/ziglang/zig.git
synced 2025-12-07 06:43:07 +00:00
The intent here is ambiguous: this resolves to the comptime_int '0', but it's likely the user meant to use a floating-point literal. Resolves: #16890
12 lines
240 B
Zig
12 lines
240 B
Zig
export fn foo() void {
|
|
_ = -0;
|
|
}
|
|
|
|
// error
|
|
// backend=stage2
|
|
// target=native
|
|
//
|
|
// :2:10: error: integer literal '-0' is ambiguous
|
|
// :2:10: note: use '0' for an integer zero
|
|
// :2:10: note: use '-0.0' for a floating-point signed zero
|