| author | |
| committer | |
| log | 9e0165147e18ffb36bcaf09112c72f4cb397d563 |
| tree | 48d6f15bbe607cf527dba7309b39add9efec654e |
| parent | 2ed72022ce56b06bb3e90ca9259065452e209eb9 |
See #222 files changed, 4 insertions(+), 2 deletions(-)
src/analyze.cpp+1-1| ... | ... | @@ -1549,7 +1549,7 @@ static void preview_fn_proto(CodeGen *g, ImportTableEntry *import, AstNode *prot |
| 1549 | 1549 | if (proto_node->data.fn_proto.generic_params.length > 0) { |
| 1550 | 1550 | return preview_generic_fn_proto(g, import, proto_node); |
| 1551 | 1551 | } else { |
| 1552 | return preview_fn_proto_instance(g, import, proto_node, import->block_context); | |
| 1552 | return preview_fn_proto_instance(g, import, proto_node, proto_node->block_context); | |
| 1553 | 1553 | } |
| 1554 | 1554 | |
| 1555 | 1555 | } |
test/self_hosted.zig+3-1| ... | ... | @@ -1572,9 +1572,11 @@ fn generic_struct() { |
| 1572 | 1572 | var a1 = GenNode(i32) {.value = 13, .next = null,}; |
| 1573 | 1573 | var b1 = GenNode(bool) {.value = true, .next = null,}; |
| 1574 | 1574 | assert(a1.value == 13); |
| 1575 | assert(b1.value); | |
| 1575 | assert(a1.value == a1.get_val()); | |
| 1576 | assert(b1.get_val()); | |
| 1576 | 1577 | } |
| 1577 | 1578 | struct GenNode(T: type) { |
| 1578 | 1579 | value: T, |
| 1579 | 1580 | next: ?&GenNode(T), |
| 1581 | fn get_val(n: &const GenNode(T)) -> T { n.value } | |
| 1580 | 1582 | } |