'importc' allows 'not nil' annotation
This commit is contained in:
parent
a2480efd68
commit
25e2e3faec
1 changed files with 2 additions and 1 deletions
|
|
@ -330,7 +330,8 @@ proc semIdentDef(c: PContext, n: PNode, kind: TSymKind): PSym =
|
||||||
styleCheckDef(result)
|
styleCheckDef(result)
|
||||||
|
|
||||||
proc checkNilable(v: PSym) =
|
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:
|
if v.ast.isNil:
|
||||||
message(v.info, warnProveInit, v.name.s)
|
message(v.info, warnProveInit, v.name.s)
|
||||||
elif tfNotNil in v.typ.flags and tfNotNil notin v.ast.typ.flags:
|
elif tfNotNil in v.typ.flags and tfNotNil notin v.ast.typ.flags:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue