Fixed getCustomPragmaVal to allow multiple fields in custom annotations (#10289)
This commit is contained in:
parent
27e2ed4375
commit
f11f36e7d5
2 changed files with 21 additions and 3 deletions
|
|
@ -219,3 +219,12 @@ block:
|
|||
check(x)
|
||||
check(y)
|
||||
check(z)
|
||||
|
||||
# pragma with multiple fields
|
||||
block:
|
||||
template myAttr(first: string, second: int, third: float) {.pragma.}
|
||||
let a {.myAttr("one", 2, 3.0).} = 0
|
||||
let ps = a.getCustomPragmaVal(myAttr)
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue