diff options
Diffstat (limited to 'test/behavior/basic.zig')
| -rw-r--r-- | test/behavior/basic.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/behavior/basic.zig b/test/behavior/basic.zig index 7351891959..3fc1cda04d 100644 --- a/test/behavior/basic.zig +++ b/test/behavior/basic.zig @@ -1127,3 +1127,14 @@ test "pointer to zero sized global is mutable" { }; try expect(@TypeOf(&S.thing) == *S.Thing); } + +test "returning an opaque type from a function" { + const S = struct { + fn foo(comptime a: u32) type { + return opaque { + const b = a; + }; + } + }; + try expect(S.foo(123).b == 123); +} |
