summary refs log tree commit diff stats
path: root/tests/ccgbugs
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2018-09-15 00:09:50 +0200
committerLemonBoy <thatlemon@gmail.com>2018-09-15 11:55:11 +0200
commit6af6ca6351f29d180f86a8521cf2f46f0e6934a7 (patch)
treeea7c9a2b04602ec2e5c39ea54d1f981c84d9041d /tests/ccgbugs
parent0c04b80651ff591beadb873c8814168e66e6b722 (diff)
downloadNim-6af6ca6351f29d180f86a8521cf2f46f0e6934a7.tar.gz
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
Diffstat (limited to 'tests/ccgbugs')
-rw-r--r--tests/ccgbugs/t8967.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ccgbugs/t8967.nim b/tests/ccgbugs/t8967.nim
new file mode 100644
index 000000000..e342b7eae
--- /dev/null
+++ b/tests/ccgbugs/t8967.nim
@@ -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 == {}