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/semexprs.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/semexprs.nim')
-rw-r--r-- | compiler/semexprs.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 5c299b95b..bd9f18645 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -152,7 +152,7 @@ proc checkConvertible(c: PContext, targetTyp: PType, src: PNode): TConvStatus = src.intVal notin firstOrd(c.config, targetTyp)..lastOrd(c.config, targetTyp): result = convNotInRange elif src.kind in nkFloatLit..nkFloat64Lit and - (classify(src.floatVal) in {fcNaN, fcNegInf, fcInf} or + (classify(src.floatVal) in {fcNan, fcNegInf, fcInf} or src.floatVal.int64 notin firstOrd(c.config, targetTyp)..lastOrd(c.config, targetTyp)): result = convNotInRange elif targetBaseTyp.kind in tyFloat..tyFloat64: @@ -160,7 +160,7 @@ proc checkConvertible(c: PContext, targetTyp: PType, src: PNode): TConvStatus = not floatRangeCheck(src.floatVal, targetTyp): result = convNotInRange elif src.kind in nkCharLit..nkUInt64Lit and - not floatRangeCheck(src.intval.float, targetTyp): + not floatRangeCheck(src.intVal.float, targetTyp): result = convNotInRange else: # we use d, s here to speed up that operation a bit: @@ -1621,7 +1621,7 @@ proc borrowCheck(c: PContext, n, le, ri: PNode) = template resultTypeIsInferrable(typ: PType): untyped = typ.isMetaType and typ.kind != tyTypeDesc -proc goodLineInfo(arg: PNode): TLineinfo = +proc goodLineInfo(arg: PNode): TLineInfo = if arg.kind == nkStmtListExpr and arg.len > 0: goodLineInfo(arg[^1]) else: @@ -2108,7 +2108,7 @@ proc instantiateCreateFlowVarCall(c: PContext; t: PType; # since it's an instantiation, we unmark it as a compilerproc. Otherwise # codegen would fail: if sfCompilerProc in result.flags: - result.flags = result.flags - {sfCompilerProc, sfExportC, sfImportC} + result.flags = result.flags - {sfCompilerProc, sfExportc, sfImportc} result.loc.r = nil proc setMs(n: PNode, s: PSym): PNode = |