diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-05-07 17:27:57 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-05-07 17:27:57 -0700 |
| commit | 9e0165147e18ffb36bcaf09112c72f4cb397d563 (patch) | |
| tree | 48d6f15bbe607cf527dba7309b39add9efec654e /test/self_hosted.zig | |
| parent | 2ed72022ce56b06bb3e90ca9259065452e209eb9 (diff) | |
| download | zig-9e0165147e18ffb36bcaf09112c72f4cb397d563.tar.gz zig-9e0165147e18ffb36bcaf09112c72f4cb397d563.zip | |
generic args available to member functions
See #22
Diffstat (limited to 'test/self_hosted.zig')
| -rw-r--r-- | test/self_hosted.zig | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/self_hosted.zig b/test/self_hosted.zig index 36c0cc9d6f..d8e4563bf2 100644 --- a/test/self_hosted.zig +++ b/test/self_hosted.zig @@ -1572,9 +1572,11 @@ fn generic_struct() { var a1 = GenNode(i32) {.value = 13, .next = null,}; var b1 = GenNode(bool) {.value = true, .next = null,}; assert(a1.value == 13); - assert(b1.value); + assert(a1.value == a1.get_val()); + assert(b1.get_val()); } struct GenNode(T: type) { value: T, next: ?&GenNode(T), + fn get_val(n: &const GenNode(T)) -> T { n.value } } |
