| author | |
| committer | |
| log | 6f5a438946dce2b201acf5b7bbe42977bc990cc4 |
| tree | 53e0290b28a6f8f6f070fb6cb08fb7ab9e7cc706 |
| parent | e60db701d13a50798222bbef2d4560245f975671 |
Closes #136972 files changed, 12 insertions(+), 0 deletions(-)
src/AstGen.zig+1| ... | ... | @@ -5070,6 +5070,7 @@ fn containerDecl( |
| 5070 | 5070 | try astgen.extra.ensureUnusedCapacity(gpa, decls_slice.len); |
| 5071 | 5071 | astgen.extra.appendSliceAssumeCapacity(decls_slice); |
| 5072 | 5072 | |
| 5073 | block_scope.unstack(); | |
| 5073 | 5074 | try gz.addNamespaceCaptures(&namespace); |
| 5074 | 5075 | return rvalue(gz, ri, indexToRef(decl_inst), node); |
| 5075 | 5076 | }, |
test/behavior/basic.zig+11| ... | ... | @@ -1127,3 +1127,14 @@ test "pointer to zero sized global is mutable" { |
| 1127 | 1127 | }; |
| 1128 | 1128 | try expect(@TypeOf(&S.thing) == *S.Thing); |
| 1129 | 1129 | } |
| 1130 | ||
| 1131 | test "returning an opaque type from a function" { | |
| 1132 | const S = struct { | |
| 1133 | fn foo(comptime a: u32) type { | |
| 1134 | return opaque { | |
| 1135 | const b = a; | |
| 1136 | }; | |
| 1137 | } | |
| 1138 | }; | |
| 1139 | try expect(S.foo(123).b == 123); | |
| 1140 | } |