miscellaneous bug fixes (part 3) (#13304)
* fix deprecation; fix indentation
* git clone: use -q
* fix Warning: pragma before generic parameter list is deprecated; fix typo
* bugfix: sysTypeFromName("float64") was never cached
This commit is contained in:
parent
79ec8c2571
commit
1f725f1d7e
6 changed files with 13 additions and 11 deletions
|
|
@ -22,9 +22,9 @@ tasks:
|
||||||
- test: |
|
- test: |
|
||||||
cd Nim
|
cd Nim
|
||||||
if ! ./koch runCI; then
|
if ! ./koch runCI; then
|
||||||
nim c -r tools/ci_testresults.nim
|
nim c -r tools/ci_testresults.nim
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
triggers:
|
triggers:
|
||||||
- action: email
|
- action: email
|
||||||
condition: failure
|
condition: failure
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ proc getSysType*(g: ModuleGraph; info: TLineInfo; kind: TTypeKind): PType =
|
||||||
of tyUInt64: result = sysTypeFromName("uint64")
|
of tyUInt64: result = sysTypeFromName("uint64")
|
||||||
of tyFloat: result = sysTypeFromName("float")
|
of tyFloat: result = sysTypeFromName("float")
|
||||||
of tyFloat32: result = sysTypeFromName("float32")
|
of tyFloat32: result = sysTypeFromName("float32")
|
||||||
of tyFloat64: return sysTypeFromName("float64")
|
of tyFloat64: result = sysTypeFromName("float64")
|
||||||
of tyFloat128: result = sysTypeFromName("float128")
|
of tyFloat128: result = sysTypeFromName("float128")
|
||||||
of tyBool: result = sysTypeFromName("bool")
|
of tyBool: result = sysTypeFromName("bool")
|
||||||
of tyChar: result = sysTypeFromName("char")
|
of tyChar: result = sysTypeFromName("char")
|
||||||
|
|
@ -79,7 +79,9 @@ proc getSysType*(g: ModuleGraph; info: TLineInfo; kind: TTypeKind): PType =
|
||||||
else: internalError(g.config, "request for typekind: " & $kind)
|
else: internalError(g.config, "request for typekind: " & $kind)
|
||||||
g.sysTypes[kind] = result
|
g.sysTypes[kind] = result
|
||||||
if result.kind != kind:
|
if result.kind != kind:
|
||||||
internalError(g.config, "wanted: " & $kind & " got: " & $result.kind)
|
if kind == tyFloat64 and result.kind == tyFloat: discard # because of aliasing
|
||||||
|
else:
|
||||||
|
internalError(g.config, "wanted: " & $kind & " got: " & $result.kind)
|
||||||
if result == nil: internalError(g.config, "type not found: " & $kind)
|
if result == nil: internalError(g.config, "type not found: " & $kind)
|
||||||
|
|
||||||
proc resetSysTypes*(g: ModuleGraph) =
|
proc resetSysTypes*(g: ModuleGraph) =
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ proc evalTypeTrait(c: PContext; traitCall: PNode, operand: PType, context: PSym)
|
||||||
newTypeWithSons(context, kind, sons).toNode(traitCall.info)
|
newTypeWithSons(context, kind, sons).toNode(traitCall.info)
|
||||||
|
|
||||||
if operand.kind == tyGenericParam or (traitCall.len > 2 and operand2.kind == tyGenericParam):
|
if operand.kind == tyGenericParam or (traitCall.len > 2 and operand2.kind == tyGenericParam):
|
||||||
return traitCall ## tpo early to evaluate
|
return traitCall ## too early to evaluate
|
||||||
|
|
||||||
let s = trait.sym.name.s
|
let s = trait.sym.name.s
|
||||||
case s
|
case s
|
||||||
|
|
|
||||||
6
koch.nim
6
koch.nim
|
|
@ -124,13 +124,13 @@ proc csource(args: string) =
|
||||||
|
|
||||||
proc bundleC2nim(args: string) =
|
proc bundleC2nim(args: string) =
|
||||||
if not dirExists("dist/c2nim/.git"):
|
if not dirExists("dist/c2nim/.git"):
|
||||||
exec("git clone https://github.com/nim-lang/c2nim.git dist/c2nim")
|
exec("git clone -q https://github.com/nim-lang/c2nim.git dist/c2nim")
|
||||||
nimCompile("dist/c2nim/c2nim",
|
nimCompile("dist/c2nim/c2nim",
|
||||||
options = "--noNimblePath --path:. " & args)
|
options = "--noNimblePath --path:. " & args)
|
||||||
|
|
||||||
proc bundleNimbleExe(latest: bool, args: string) =
|
proc bundleNimbleExe(latest: bool, args: string) =
|
||||||
if not dirExists("dist/nimble/.git"):
|
if not dirExists("dist/nimble/.git"):
|
||||||
exec("git clone https://github.com/nim-lang/nimble.git dist/nimble")
|
exec("git clone -q https://github.com/nim-lang/nimble.git dist/nimble")
|
||||||
if not latest:
|
if not latest:
|
||||||
withDir("dist/nimble"):
|
withDir("dist/nimble"):
|
||||||
exec("git fetch")
|
exec("git fetch")
|
||||||
|
|
@ -152,7 +152,7 @@ proc buildNimble(latest: bool, args: string) =
|
||||||
while dirExists("dist/nimble" & $id):
|
while dirExists("dist/nimble" & $id):
|
||||||
inc id
|
inc id
|
||||||
installDir = "dist/nimble" & $id
|
installDir = "dist/nimble" & $id
|
||||||
exec("git clone https://github.com/nim-lang/nimble.git " & installDir)
|
exec("git clone -q https://github.com/nim-lang/nimble.git " & installDir)
|
||||||
withDir(installDir):
|
withDir(installDir):
|
||||||
if latest:
|
if latest:
|
||||||
exec("git checkout -f master")
|
exec("git checkout -f master")
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ block genericParams:
|
||||||
# bug 13095
|
# bug 13095
|
||||||
|
|
||||||
type
|
type
|
||||||
CpuStorage{.shallow.}[T] = ref object
|
CpuStorage[T] {.shallow.} = ref object
|
||||||
when supportsCopyMem(T):
|
when supportsCopyMem(T):
|
||||||
raw_buffer*: ptr UncheckedArray[T] # 8 bytes
|
raw_buffer*: ptr UncheckedArray[T] # 8 bytes
|
||||||
memalloc*: pointer # 8 bytes
|
memalloc*: pointer # 8 bytes
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import os, json, sets, strformat
|
import os, json, sets, strformat
|
||||||
|
|
||||||
const skip = toSet(["reDisabled", "reIgnored", "reSuccess", "reJoined"])
|
const skip = toHashSet(["reDisabled", "reIgnored", "reSuccess", "reJoined"])
|
||||||
|
|
||||||
when isMainModule:
|
when isMainModule:
|
||||||
for fn in walkFiles("testresults/*.json"):
|
for fn in walkFiles("testresults/*.json"):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue