From e46a735bb5a6720851fef4630cea1adeff9ae1fd Mon Sep 17 00:00:00 2001 From: Clay Sweetser Date: Sat, 9 Aug 2014 16:40:35 -0400 Subject: [PATCH] Fixes #1435 --- compiler/semexprs.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index d040675fa1..bf13727e59 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -199,6 +199,8 @@ proc isCastable(dst, src: PType): bool = result = (dstSize >= srcSize) or (skipTypes(dst, abstractInst).kind in IntegralTypes) or (skipTypes(src, abstractInst-{tyTypeDesc}).kind in IntegralTypes) + if result and src.kind == tyNil: + result = dst.size <= platform.ptrSize proc isSymChoice(n: PNode): bool {.inline.} = result = n.kind in nkSymChoices