Prevent crash on pragma templates w/ generics (#10685)

* Prevent crash on pragma templates w/ generics

* Remove incorrect call to pragma reconversion

`semOverloadedCall` may return a node with more elements than the
original nkCall node had (implicit and/or explicit generics).
This commit is contained in:
LemonBoy
2019-02-18 12:17:00 +01:00
committed by Andreas Rumpf
parent 8b39551fca
commit cf32d61fa5
3 changed files with 26 additions and 11 deletions

View File

@@ -1515,7 +1515,7 @@ macro getCustomPragmaVal*(n: typed, cp: typed{nkSym}): untyped =
else:
let def = p[0].getImpl[3]
result = newTree(nnkPar)
for i in 1..<p.len:
for i in 1 ..< def.len:
let key = def[i][0]
let val = p[i]
result.add newTree(nnkExprColonExpr, key, val)