diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-07-19 15:40:21 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-07-19 15:40:21 +0200 |
commit | d455d58af6c511414f59eff2fffd64379dd4deac (patch) | |
tree | c3e2945977be0baa332d5e1b439077d0d92b4caf /compiler | |
parent | 2d8572e9489cff5a047b87d5a30a6886d96b93ad (diff) | |
download | Nim-d455d58af6c511414f59eff2fffd64379dd4deac.tar.gz |
fixes #4345
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ccgexprs.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index c47478b9c..3f12fed2c 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -1568,11 +1568,12 @@ proc genSomeCast(p: BProc, e: PNode, d: var TLoc) = [getTypeDesc(p.module, e.typ), rdCharLoc(a)], a.s) proc genCast(p: BProc, e: PNode, d: var TLoc) = - const floatTypes = {tyFloat..tyFloat128} + const ValueTypes = {tyFloat..tyFloat128, tyTuple, tyObject, + tyArray, tyArrayConstr} let destt = skipTypes(e.typ, abstractRange) srct = skipTypes(e.sons[1].typ, abstractRange) - if destt.kind in floatTypes or srct.kind in floatTypes: + if destt.kind in ValueTypes or srct.kind in ValueTypes: # 'cast' and some float type involved? --> use a union. inc(p.labels) var lbl = p.labels.rope |