diff options
author | LemonBoy <thatlemon@gmail.com> | 2018-09-28 09:59:45 +0200 |
---|---|---|
committer | LemonBoy <thatlemon@gmail.com> | 2018-09-28 09:59:45 +0200 |
commit | a1083d7c43e34fddd9097f7d0122db08092a13ac (patch) | |
tree | 0ade0e6c8182731d44d16ac834fe38dc3fab6ca7 /tests | |
parent | 07748dba68a2edba4163e8dfbdf7b09251e8cc30 (diff) | |
download | Nim-a1083d7c43e34fddd9097f7d0122db08092a13ac.tar.gz |
Fix codegen for some set operations
Taking the LHS type when a temporary result value was needed lead to bad code being generated if we get a tyRef. Fixes #9098
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ccgbugs/t9098.nim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ccgbugs/t9098.nim b/tests/ccgbugs/t9098.nim new file mode 100644 index 000000000..e1dbb6883 --- /dev/null +++ b/tests/ccgbugs/t9098.nim @@ -0,0 +1,12 @@ +discard """ + targets: "c cpp js" + output: ''' +{'a', 'b'} +''' +""" + +var x = new(ref set[char]) +var y = new(ref set[char]) +x[] = {'a'} +y[] = {'b'} +echo x[] + y[] |