From 0eddf0cbc0a88121a67239d5899dca8a39c39cd8 Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Sun, 18 Dec 2022 00:45:07 +0200 Subject: Sema: fix condition for non-pointer noalias error Closes #13987 --- src/Sema.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Sema.zig b/src/Sema.zig index ede4eaf0e7..e8ed010a7c 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -8820,7 +8820,9 @@ fn analyzeParameter( }; return sema.failWithOwnedErrorMsg(msg); } - if (!this_generic and is_noalias and !param.ty.isPtrAtRuntime()) { + if (!sema.is_generic_instantiation and !this_generic and is_noalias and + !(param.ty.zigTypeTag() == .Pointer or param.ty.isPtrLikeOptional())) + { return sema.fail(block, param_src, "non-pointer parameter declared noalias", .{}); } } -- cgit v1.2.3