diag: guide parameter mutability and explicit array slice arguments

This commit is contained in:
dev committed 2026-10-09 21:12:26 +03:00
1 parent 6a02659f31
commit 9549a3dec6
22 files changed
+197 -4

No files matched your search

+2
View File
@@ -374,6 +374,8 @@ const Parser = struct {
var params: std.ArrayList(ast.Param) = .empty;
while (p.peek().tag != .r_paren) {
const ps = p.peek().pos;
if (p.atWord("mut") and p.peekAt(1).tag == .ident and !isKeyword(p.peekAt(1).text) and p.peekAt(2).tag == .colon)
return p.failAdvice(p.peek(), "parameter name", .parameter_mutability);
const pname = try p.ident("parameter name");
_ = try p.expect(.colon, "`:`");
const ty = try p.typeExpr();