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:
parent
b34412ff0f
commit
05c6db6500
5 changed files with 131 additions and 3 deletions
|
|
@ -642,8 +642,9 @@ proc semTemplateDef(c: PContext, n: PNode): PNode =
|
|||
# body by the absence of the sfGenSym flag:
|
||||
for i in 1..<s.typ.n.len:
|
||||
let param = s.typ.n[i].sym
|
||||
param.flags.incl sfTemplateParam
|
||||
param.flags.excl sfGenSym
|
||||
if param.name.s != "_":
|
||||
param.flags.incl sfTemplateParam
|
||||
param.flags.excl sfGenSym
|
||||
if param.typ.kind != tyUntyped: allUntyped = false
|
||||
else:
|
||||
s.typ = newTypeS(tyProc, c)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue