diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2023-06-22 18:46:56 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-24 16:56:39 -0700 |
| commit | f26dda21171e26f44aeec8c59a75bbb3331eeb2e (patch) | |
| tree | c935248861ae2693b314f2c8bc78fe38d9961b6d /test/cbe.zig | |
| parent | 447ca4e3fff021f471b748187b53f0a4744ad0bc (diff) | |
| download | zig-f26dda21171e26f44aeec8c59a75bbb3331eeb2e.tar.gz zig-f26dda21171e26f44aeec8c59a75bbb3331eeb2e.zip | |
all: migrate code to new cast builtin syntax
Most of this migration was performed automatically with `zig fmt`. There
were a few exceptions which I had to manually fix:
* `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten
* `@truncate`'s fixup is incorrect for vectors
* Test cases are not formatted, and their error locations change
Diffstat (limited to 'test/cbe.zig')
| -rw-r--r-- | test/cbe.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/cbe.zig b/test/cbe.zig index f0cf720fd3..b56202c7e5 100644 --- a/test/cbe.zig +++ b/test/cbe.zig @@ -642,7 +642,7 @@ pub fn addCases(ctx: *Cases) !void { \\pub export fn main() c_int { \\ var number1 = Number.One; \\ var number2: Number = .Two; - \\ const number3 = @enumFromInt(Number, 2); + \\ const number3: Number = @enumFromInt(2); \\ if (number1 == number2) return 1; \\ if (number2 == number3) return 1; \\ if (@intFromEnum(number1) != 0) return 1; @@ -737,19 +737,19 @@ pub fn addCases(ctx: *Cases) !void { case.addError( \\pub export fn main() c_int { \\ const a = 1; - \\ _ = @enumFromInt(bool, a); + \\ _ = @as(bool, @enumFromInt(a)); \\} , &.{ - ":3:20: error: expected enum, found 'bool'", + ":3:19: error: expected enum, found 'bool'", }); case.addError( \\const E = enum { a, b, c }; \\pub export fn main() c_int { - \\ _ = @enumFromInt(E, 3); + \\ _ = @as(E, @enumFromInt(3)); \\} , &.{ - ":3:9: error: enum 'tmp.E' has no tag with value '3'", + ":3:16: error: enum 'tmp.E' has no tag with value '3'", ":1:11: note: enum declared here", }); |
