summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-01-18 20:49:56 +0100
committerAraq <rumpf_a@web.de>2015-01-18 20:49:56 +0100
commit71d3cccb07bb824df10c5dd90493aaf16350e171 (patch)
treef5dc3922815bd4939b8c935ac51c9ed9ec549b30 /compiler
parentbb3dae3a9196abbe663ffbdf6f065eba86d6c548 (diff)
downloadNim-71d3cccb07bb824df10c5dd90493aaf16350e171.tar.gz
fixes #1833
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgexprs.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 2d3cf562b..90aefd7d6 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -1569,7 +1569,8 @@ proc genRangeChck(p: BProc, n: PNode, d: var TLoc, magic: string) =
         toRope(magic)]))
 
 proc genConv(p: BProc, e: PNode, d: var TLoc) =
-  if compareTypes(e.typ, e.sons[1].typ, dcEqIgnoreDistinct):
+  let destType = e.typ.skipTypes({tyVar, tyGenericInst})
+  if compareTypes(destType, e.sons[1].typ, dcEqIgnoreDistinct):
     expr(p, e.sons[1], d)
   else:
     genSomeCast(p, e, d)