diff options
author | Araq <rumpf_a@web.de> | 2015-11-26 11:52:52 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-11-26 17:46:05 +0100 |
commit | 25e2e3faecd067eee06d6185c1c991ab84985940 (patch) | |
tree | 3b08bf27ca46cd4450bb171e5a2194bc0c9ceb56 | |
parent | a2480efd68e19a18342fdb01e11aa338dadfe5ab (diff) | |
download | Nim-25e2e3faecd067eee06d6185c1c991ab84985940.tar.gz |
'importc' allows 'not nil' annotation
-rw-r--r-- | compiler/semstmts.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index adb1c81c1..ebea2dd67 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: |