mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
overflow intrinsics take type as first argument
This commit is contained in:
1 parent
68c4f617ed
commit
0c9afede9e
6 files changed
+183
-199
No files matched your search
+2
-2
@@ -986,10 +986,10 @@ fn f(c: u8) u8 => {
|
||||
use "std.zig";
|
||||
pub fn main(argc: isize, argv: &&u8, env: &&u8) i32 => {
|
||||
var result: u8;
|
||||
if (!@add_with_overflow_u8(250, 100, &result)) {
|
||||
if (!@add_with_overflow(u8, 250, 100, &result)) {
|
||||
print_str("BAD\n");
|
||||
}
|
||||
if (@add_with_overflow_u8(100, 150, &result)) {
|
||||
if (@add_with_overflow(u8, 100, 150, &result)) {
|
||||
print_str("BAD\n");
|
||||
}
|
||||
if (result != 250) {
|
||||
|
||||
Reference in new issue
Block a user