closes #17864; add a test case (#21434)

(cherry picked from commit d4782c9e42)
This commit is contained in:
ringabout
2023-02-25 00:53:04 +08:00
committed by narimiran
parent 025ada1809
commit ca620d6089

View File

@@ -445,3 +445,15 @@ static:
needSecondIdentifier.mgetOrPut(firstPart, @[]).add((name, pattern))
doAssert needSecondIdentifier[0] == @[("aaaa", "bbbb"), ("aaaaa", "bbbbb"), ("aaaaaa", "bbbbbb"), ("aaaaaaa", "bbbbbbb"), ("aaaaaaaa", "bbbbb")]
# bug #17864
macro transform*(fn: typed) =
quote do:
`fn`
var map: Table[string, HashSet[string]]
proc publish*(): void {.transform.} =
map["k"] = init_hash_set[string]()
map["k"].incl "d"
publish()