underscores for routine parameters (#21192)

* underscores for routine parameters

fixes #13443, fixes #13804, refs #21121

* add changelog + more tests

* support generics and ensure inferred lambdas work
This commit is contained in:
metagn 2023-01-08 08:49:49 +03:00 • committed by GitHub
commit 05c6db6500
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 131 additions and 3 deletions

View file

@ -323,6 +323,7 @@ proc wrongRedefinition*(c: PContext; info: TLineInfo, s: string;
# xxx pending bootstrap >= 1.4, replace all those overloads with a single one:
# proc addDecl*(c: PContext, sym: PSym, info = sym.info, scope = c.currentScope) {.inline.} =
proc addDeclAt*(c: PContext; scope: PScope, sym: PSym, info: TLineInfo) =
if sym.name.s == "_": return
let conflict = scope.addUniqueSym(sym)
if conflict != nil:
if sym.kind == skModule and conflict.kind == skModule and sym.owner == conflict.owner: