diff options
author | Araq <rumpf_a@web.de> | 2019-07-10 12:42:23 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2019-07-10 12:42:41 +0200 |
commit | c94647aecad6ed7fd12152800437a6cda11e06e6 (patch) | |
tree | f876ae0ac6379dfd99fd5d5ed7d8903be96b433b /compiler/semstmts.nim | |
parent | 96523cdd3e8ada367b804efbd47f4763a1269fa8 (diff) | |
download | Nim-c94647aecad6ed7fd12152800437a6cda11e06e6.tar.gz |
styleCheck: make the compiler and large parts of the stdlib compatible with --styleCheck:error
Diffstat (limited to 'compiler/semstmts.nim')
-rw-r--r-- | compiler/semstmts.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 430380944..e26bcbed7 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -333,7 +333,7 @@ proc semIdentDef(c: PContext, n: PNode, kind: TSymKind): PSym = suggestSym(c.config, info, result, c.graph.usageSym) proc checkNilable(c: PContext; v: PSym) = - if {sfGlobal, sfImportC} * v.flags == {sfGlobal} and + if {sfGlobal, sfImportc} * v.flags == {sfGlobal} and {tfNotNil, tfNeedsInit} * v.typ.flags != {}: if v.astdef.isNil: message(c.config, v.info, warnProveInit, v.name.s) @@ -1009,7 +1009,6 @@ proc typeSectionLeftSidePass(c: PContext, n: PNode) = let typsym = pkg.tab.strTableGet(typName) if typsym.isNil: s = semIdentDef(c, name[1], skType) - styleCheckDef(c.config, s) onDef(name[1].info, s) s.typ = newTypeS(tyObject, c) s.typ.sym = s @@ -1024,7 +1023,6 @@ proc typeSectionLeftSidePass(c: PContext, n: PNode) = s = typsym else: s = semIdentDef(c, name, skType) - styleCheckDef(c.config, s) onDef(name.info, s) s.typ = newTypeS(tyForward, c) s.typ.sym = s # process pragmas: @@ -1253,6 +1251,8 @@ proc typeSectionFinalPass(c: PContext, n: PNode) = if a.kind == nkCommentStmt: continue let name = typeSectionTypeName(c, a.sons[0]) var s = name.sym + # check the style here after the pragmas have been processed: + styleCheckDef(c.config, s) # compute the type's size and check for illegal recursions: if a.sons[1].kind == nkEmpty: var x = a[2] @@ -1286,7 +1286,7 @@ proc semAllTypeSections(c: PContext; n: PNode): PNode = of nkIncludeStmt: for i in 0..<n.len: var f = checkModuleName(c.config, n.sons[i]) - if f != InvalidFileIDX: + if f != InvalidFileIdx: if containsOrIncl(c.includedFiles, f.int): localError(c.config, n.info, errRecursiveDependencyX % toMsgFilename(c.config, f)) else: @@ -2021,7 +2021,7 @@ proc semMacroDef(c: PContext, n: PNode): PNode = proc incMod(c: PContext, n: PNode, it: PNode, includeStmtResult: PNode) = var f = checkModuleName(c.config, it) - if f != InvalidFileIDX: + if f != InvalidFileIdx: if containsOrIncl(c.includedFiles, f.int): localError(c.config, n.info, errRecursiveDependencyX % toMsgFilename(c.config, f)) else: |