mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 14:55:24 +00:00
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:
@@ -233,3 +233,10 @@ block:
|
||||
doAssert ps.first == ps[0] and ps.first == "one"
|
||||
doAssert ps.second == ps[1] and ps.second == 2
|
||||
doAssert ps.third == ps[2] and ps.third == 3.0
|
||||
|
||||
# pragma with implicit&explicit generic types
|
||||
block:
|
||||
template fooBar[T](x: T; c: static[int] = 42; m: char) {.pragma.}
|
||||
var e {.fooBar("foo", 123, 'u').}: int
|
||||
doAssert(hasCustomPragma(e, fooBar))
|
||||
doAssert(getCustomPragmaVal(e, fooBar).c == 123)
|
||||
|
||||
Reference in New Issue
Block a user