| ... | @@ -422,10 +422,10 @@ test "zig fmt: asm expression with comptime content" { | ... | @@ -422,10 +422,10 @@ test "zig fmt: asm expression with comptime content" { |
| 422 | ); | 422 | ); |
| 423 | } | 423 | } |
| 424 | | 424 | |
| 425 | test "zig fmt: var struct field" { | 425 | test "zig fmt: anytype struct field" { |
| 426 | try testCanonical( | 426 | try testCanonical( |
| 427 | \\pub const Pointer = struct { | 427 | \\pub const Pointer = struct { |
| 428 | \\ sentinel: var, | 428 | \\ sentinel: anytype, |
| 429 | \\}; | 429 | \\}; |
| 430 | \\ | 430 | \\ |
| 431 | ); | 431 | ); |
| ... | @@ -1932,7 +1932,7 @@ test "zig fmt: preserve spacing" { | ... | @@ -1932,7 +1932,7 @@ test "zig fmt: preserve spacing" { |
| 1932 | test "zig fmt: return types" { | 1932 | test "zig fmt: return types" { |
| 1933 | try testCanonical( | 1933 | try testCanonical( |
| 1934 | \\pub fn main() !void {} | 1934 | \\pub fn main() !void {} |
| 1935 | \\pub fn main() var {} | 1935 | \\pub fn main() anytype {} |
| 1936 | \\pub fn main() i32 {} | 1936 | \\pub fn main() i32 {} |
| 1937 | \\ | 1937 | \\ |
| 1938 | ); | 1938 | ); |
| ... | @@ -2140,9 +2140,9 @@ test "zig fmt: call expression" { | ... | @@ -2140,9 +2140,9 @@ test "zig fmt: call expression" { |
| 2140 | ); | 2140 | ); |
| 2141 | } | 2141 | } |
| 2142 | | 2142 | |
| 2143 | test "zig fmt: var type" { | 2143 | test "zig fmt: anytype type" { |
| 2144 | try testCanonical( | 2144 | try testCanonical( |
| 2145 | \\fn print(args: var) var {} | 2145 | \\fn print(args: anytype) anytype {} |
| 2146 | \\ | 2146 | \\ |
| 2147 | ); | 2147 | ); |
| 2148 | } | 2148 | } |
| ... | @@ -3180,6 +3180,22 @@ test "zig fmt: convert extern fn proto into callconv(.C)" { | ... | @@ -3180,6 +3180,22 @@ test "zig fmt: convert extern fn proto into callconv(.C)" { |
| 3180 | ); | 3180 | ); |
| 3181 | } | 3181 | } |
| 3182 | | 3182 | |
| | 3183 | test "zig fmt: convert var to anytype" { |
| | 3184 | // TODO remove in next release cycle |
| | 3185 | try testTransform( |
| | 3186 | \\pub fn main( |
| | 3187 | \\ a: var, |
| | 3188 | \\ bar: var, |
| | 3189 | \\) void {} |
| | 3190 | , |
| | 3191 | \\pub fn main( |
| | 3192 | \\ a: anytype, |
| | 3193 | \\ bar: anytype, |
| | 3194 | \\) void {} |
| | 3195 | \\ |
| | 3196 | ); |
| | 3197 | } |
| | 3198 | |
| 3183 | const std = @import("std"); | 3199 | const std = @import("std"); |
| 3184 | const mem = std.mem; | 3200 | const mem = std.mem; |
| 3185 | const warn = std.debug.warn; | 3201 | const warn = std.debug.warn; |