From 25e2e3faecd067eee06d6185c1c991ab84985940 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 26 Nov 2015 11:52:52 +0100 Subject: [PATCH] 'importc' allows 'not nil' annotation --- compiler/semstmts.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index adb1c81c11..ebea2dd672 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -330,7 +330,8 @@ proc semIdentDef(c: PContext, n: PNode, kind: TSymKind): PSym = styleCheckDef(result) proc checkNilable(v: PSym) = - if sfGlobal in v.flags and {tfNotNil, tfNeedsInit} * v.typ.flags != {}: + if {sfGlobal, sfImportC} * v.flags == {sfGlobal} and + {tfNotNil, tfNeedsInit} * v.typ.flags != {}: if v.ast.isNil: message(v.info, warnProveInit, v.name.s) elif tfNotNil in v.typ.flags and tfNotNil notin v.ast.typ.flags: