2017-12-14 02:53:52 +00:00
|
|
|
const std = @import("std");
|
|
|
|
const other_file = @import("655_other_file.zig");
|
|
|
|
|
2018-10-15 23:23:47 +01:00
|
|
|
test "function with *const parameter with type dereferenced by namespace" {
|
2017-12-14 02:53:52 +00:00
|
|
|
const x: other_file.Integer = 1234;
|
2021-05-04 19:23:22 +01:00
|
|
|
comptime try std.testing.expect(@TypeOf(&x) == *const other_file.Integer);
|
|
|
|
try foo(&x);
|
2017-12-14 02:53:52 +00:00
|
|
|
}
|
|
|
|
|
2021-05-04 19:23:22 +01:00
|
|
|
fn foo(x: *const other_file.Integer) !void {
|
|
|
|
try std.testing.expect(x.* == 1234);
|
2017-12-14 02:53:52 +00:00
|
|
|
}
|