2017-12-14 10:53:52 +08:00
|
|
|
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;
|
2018-05-31 22:56:59 +08:00
|
|
|
comptime std.debug.assert(@typeOf(&x) == *const other_file.Integer);
|
2017-12-14 10:53:52 +08:00
|
|
|
foo(x);
|
|
|
|
}
|
|
|
|
|
2018-05-31 22:56:59 +08:00
|
|
|
fn foo(x: *const other_file.Integer) void {
|
2018-05-01 08:35:54 +08:00
|
|
|
std.debug.assert(x.* == 1234);
|
2017-12-14 10:53:52 +08:00
|
|
|
}
|