From 3a5dfd6a0390f71eb620f73fe08018f4ca5af96a Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 8 Oct 2016 10:25:55 +0200 Subject: [PATCH] fixes #4845 --- compiler/semexprs.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 93d5ed1a2b..fbbaaf483b 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -136,8 +136,10 @@ proc isCastable(dst, src: PType): bool = # tyProc, tySet, tyEnum, tyBool, tyChar} if skipTypes(dst, abstractInst-{tyOpenArray}).kind == tyOpenArray: return false - var dstSize, srcSize: BiggestInt + if skipTypes(src, abstractInst-{tyTypeDesc}).kind == tyTypeDesc: + return false + var dstSize, srcSize: BiggestInt dstSize = computeSize(dst) srcSize = computeSize(src) if dstSize < 0: