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 /doc | |
| 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 'doc')
| -rw-r--r-- | doc/langref.html.in | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in index 0de6650c56..a9281b4918 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -4695,6 +4695,13 @@ fn peerTypeEmptyArrayAndSliceAndError(a: bool, slice: []u8) anyerror![]u8 { return slice[0..1]; } + +test "peer type resolution: *const T and ?*T" { + const a = @intToPtr(*const usize, 0x123456789); + const b = @intToPtr(?*usize, 0x123456789); + assert(a == b); + assert(b == a); +} {#code_end#} {#header_close#} {#header_close#} |
