zig/test/cases/bugs/655.zig
Andrew Kelley f55fdc00fc fix const and volatile qualifiers being dropped sometimes
in the expression `&const a.b`, the const (and/or volatile)
qualifiers would be incorrectly dropped.

closes #655
2017-12-13 21:53:52 -05:00

13 lines
358 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;
comptime std.debug.assert(@typeOf(&x) == &const other_file.Integer);
foo(x);
}
fn foo(x: &const other_file.Integer) {
std.debug.assert(*x == 1234);
}