From 7a09b3b57b6e715e4bca492904d26341d2f91ce9 Mon Sep 17 00:00:00 2001 From: Clay Sweetser Date: Fri, 8 Aug 2014 17:22:50 -0400 Subject: [PATCH] Fix #1424 some more --- compiler/semexprs.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index c8d95886d5..14129332cc 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -185,19 +185,23 @@ proc isCastable(dst, src: PType): bool = # castableTypeKinds = {tyInt, tyPtr, tyRef, tyCstring, tyString, # tySequence, tyPointer, tyNil, tyOpenArray, # tyProc, tySet, tyEnum, tyBool, tyChar} - if dst.kind == tyOpenArray: + if skipTypes(dst, abstractInst-{tyOpenArray}).kind == tyOpenArray: return false var dstSize, srcSize: BiggestInt dstSize = computeSize(dst) srcSize = computeSize(src) if dstSize < 0: + echo 'a' result = false elif srcSize < 0: + echo 'b' result = false elif not typeAllowed(dst, skParam): + echo 'c' result = false else: + echo 'd' result = (dstSize >= srcSize) or (skipTypes(dst, abstractInst).kind in IntegralTypes) or (skipTypes(src, abstractInst-{tyTypeDesc}).kind in IntegralTypes)