diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-03-23 18:46:20 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-03-23 18:48:12 -0400 |
| commit | 4d50bc3f8dd2b9fd5b7dde6f63f104aaba6dbf5a (patch) | |
| tree | 57890fd7b757fd39103327ffd05d1f4352d21128 /test/stage1/behavior | |
| parent | 89953ec83d8afe4fed0fc9e3cdded09c7522bf86 (diff) | |
| download | zig-4d50bc3f8dd2b9fd5b7dde6f63f104aaba6dbf5a.tar.gz zig-4d50bc3f8dd2b9fd5b7dde6f63f104aaba6dbf5a.zip | |
add peer type resolution for `*const T` and `?*T`
closes #1298
Diffstat (limited to 'test/stage1/behavior')
| -rw-r--r-- | test/stage1/behavior/pointers.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/stage1/behavior/pointers.zig b/test/stage1/behavior/pointers.zig index 1bb23866b4..5b73cd98df 100644 --- a/test/stage1/behavior/pointers.zig +++ b/test/stage1/behavior/pointers.zig @@ -130,3 +130,10 @@ test "initialize const optional C pointer to null" { expect(a == null); comptime expect(a == null); } + +test "compare equality of optional and non-optional pointer" { + const a = @intToPtr(*const usize, 0x123456789); + const b = @intToPtr(?*usize, 0x123456789); + expect(a == b); + expect(b == a); +} |
