aboutsummaryrefslogtreecommitdiff
path: root/test/cases
diff options
context:
space:
mode:
authorAnton Lilja <12533691+antlilja@users.noreply.github.com>2023-07-12 08:35:50 +0200
committerGitHub <noreply@github.com>2023-07-11 23:35:50 -0700
commitff0e2ab3983f0be241e02c1f37db795e5d02ed56 (patch)
treebde59ee7be0d43d60bc61e3651e7caf503b41ab2 /test/cases
parent660955c0d64fdbda41e1ff7dddc40c5c4393c42c (diff)
downloadzig-ff0e2ab3983f0be241e02c1f37db795e5d02ed56.tar.gz
zig-ff0e2ab3983f0be241e02c1f37db795e5d02ed56.zip
Fixes wrong error location for unionInit when first parameter is not a type (#16384)
Diffstat (limited to 'test/cases')
-rw-r--r--test/cases/compile_errors/union_init_with_non_type_as_first_param.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/cases/compile_errors/union_init_with_non_type_as_first_param.zig b/test/cases/compile_errors/union_init_with_non_type_as_first_param.zig
new file mode 100644
index 0000000000..a99a9157e1
--- /dev/null
+++ b/test/cases/compile_errors/union_init_with_non_type_as_first_param.zig
@@ -0,0 +1,9 @@
+export fn u() void {
+ _ = @unionInit(0, "a", 0);
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// :2:20: error: expected type 'type', found 'comptime_int'