diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-06-17 14:40:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-17 14:40:07 -0400 |
| commit | 431fda414189e012252614c7cf3702b46b305e35 (patch) | |
| tree | 929ff496c8b03785eb425329318f5b38170d6962 /test/compile_errors.zig | |
| parent | e5956f23ca702b79a3a4b0f0440a2fe88e0231e5 (diff) | |
| parent | 74ccf56a4b1da78b6cd6b0ac34dd6ded1e15b155 (diff) | |
| download | zig-431fda414189e012252614c7cf3702b46b305e35.tar.gz zig-431fda414189e012252614c7cf3702b46b305e35.zip | |
Merge pull request #1123 from ziglang/remove-number-casting-syntax
Remove number casting syntax
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index ed46e43066..b51a6e9761 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2931,10 +2931,10 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { "cast negative value to unsigned integer", \\comptime { \\ const value: i32 = -1; - \\ const unsigned = u32(value); + \\ const unsigned = @intCast(u32, value); \\} , - ".tmp_source.zig:3:25: error: attempt to cast negative value to unsigned integer", + ".tmp_source.zig:3:22: error: attempt to cast negative value to unsigned integer", ); cases.add( @@ -2963,10 +2963,10 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { "compile-time integer cast truncates bits", \\comptime { \\ const spartan_count: u16 = 300; - \\ const byte = u8(spartan_count); + \\ const byte = @intCast(u8, spartan_count); \\} , - ".tmp_source.zig:3:20: error: cast from 'u16' to 'u8' truncates bits", + ".tmp_source.zig:3:18: error: cast from 'u16' to 'u8' truncates bits", ); cases.add( |
