zig/test/behavior/bugs/655.zig
Eric Joldasov d884d7050e
all: replace comptime try with try comptime
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13 23:46:58 +06:00

13 lines
382 B
Zig

const std = @import("std");
const other_file = @import("655_other_file.zig");
test "function with *const parameter with type dereferenced by namespace" {
const x: other_file.Integer = 1234;
try comptime std.testing.expect(@TypeOf(&x) == *const other_file.Integer);
try foo(&x);
}
fn foo(x: *const other_file.Integer) !void {
try std.testing.expect(x.* == 1234);
}