aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/basic.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-11-29 19:59:55 -0500
committerGitHub <noreply@github.com>2022-11-29 19:59:55 -0500
commitb8473ae7d333ea2750e55e712722d446076e99d9 (patch)
treefb83bd2e26fb33d7f244abfe03d966b98e9a1b8d /test/behavior/basic.zig
parent648579b33060888316649b0d42cd03dd52ecf589 (diff)
parentb2b1d421c35ba602ddfadf94190d956de3293c62 (diff)
downloadzig-b8473ae7d333ea2750e55e712722d446076e99d9.tar.gz
zig-b8473ae7d333ea2750e55e712722d446076e99d9.zip
Merge pull request #13693 from Vexu/safety
Safety panic improvements & some bug fixes
Diffstat (limited to 'test/behavior/basic.zig')
-rw-r--r--test/behavior/basic.zig11
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);
+}