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
This commit is contained in:
parent
07748dba68
commit
a1083d7c43
2 changed files with 13 additions and 1 deletions
12
tests/ccgbugs/t9098.nim
Normal file
12
tests/ccgbugs/t9098.nim
Normal file
|
|
@ -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[]
|
||||
Loading…
Add table
Add a link
Reference in a new issue