Fix codegen for set[T] parameters
Sometimes sets are materialized as arrays and we must treat them as such: the CPP backend is pickier than the C one and would sometimes produce invalid code. Fixes #8967
This commit is contained in:
parent
0c04b80651
commit
6af6ca6351
3 changed files with 20 additions and 8 deletions
10
tests/ccgbugs/t8967.nim
Normal file
10
tests/ccgbugs/t8967.nim
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
discard """
|
||||
targets: "c cpp"
|
||||
"""
|
||||
|
||||
import marshal
|
||||
|
||||
let orig: set[char] = {'A'..'Z'}
|
||||
let m = $$orig
|
||||
let old = to[set[char]](m)
|
||||
doAssert orig - old == {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue