From d455d58af6c511414f59eff2fffd64379dd4deac Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Tue, 19 Jul 2016 15:40:21 +0200 Subject: fixes #4345 --- compiler/ccgexprs.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler') 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 -- cgit 1.4.1-2-gfad0