aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/src.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2023-03-21 14:55:36 +0200
committerGitHub <noreply@github.com>2023-03-21 14:55:36 +0200
commitf7204c7f37ee69462b9ad41a76454831e0df09d0 (patch)
treef6a68e9131f8bf8eec7ce7161209c3a52e84390a /test/behavior/src.zig
parent515e1c93e18d81435410f2cb45f3788c6be13fbf (diff)
parente70a0b2a6b329a76e9edc4d22c7b923841703a24 (diff)
downloadzig-f7204c7f37ee69462b9ad41a76454831e0df09d0.tar.gz
zig-f7204c7f37ee69462b9ad41a76454831e0df09d0.zip
Merge pull request #15028 from Vexu/compile-errors
Sema: improve error message of field access of wrapped type
Diffstat (limited to 'test/behavior/src.zig')
-rw-r--r--test/behavior/src.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/behavior/src.zig b/test/behavior/src.zig
index 77e420afcf..e6b84e5d56 100644
--- a/test/behavior/src.zig
+++ b/test/behavior/src.zig
@@ -32,3 +32,14 @@ test "@src used as a comptime parameter" {
const T2 = S.Foo(@src());
try expect(T1 != T2);
}
+
+test "@src in tuple passed to anytype function" {
+ const S = struct {
+ fn Foo(a: anytype) u32 {
+ return a[0].line;
+ }
+ };
+ const l1 = S.Foo(.{@src()});
+ const l2 = S.Foo(.{@src()});
+ try expect(l1 != l2);
+}