Skip to content

[TODO] miscellaneous bug fixes (part 3) #13304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .builds/freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ tasks:
- test: |
cd Nim
if ! ./koch runCI; then
nim c -r tools/ci_testresults.nim
exit 1
fi
nim c -r tools/ci_testresults.nim
exit 1
fi
triggers:
- action: email
condition: failure
Expand Down
6 changes: 4 additions & 2 deletions compiler/magicsys.nim
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ proc getSysType*(g: ModuleGraph; info: TLineInfo; kind: TTypeKind): PType =
of tyUInt64: result = sysTypeFromName("uint64")
of tyFloat: result = sysTypeFromName("float")
of tyFloat32: result = sysTypeFromName("float32")
of tyFloat64: return sysTypeFromName("float64")
of tyFloat64: result = sysTypeFromName("float64")
of tyFloat128: result = sysTypeFromName("float128")
of tyBool: result = sysTypeFromName("bool")
of tyChar: result = sysTypeFromName("char")
Expand All @@ -79,7 +79,9 @@ proc getSysType*(g: ModuleGraph; info: TLineInfo; kind: TTypeKind): PType =
else: internalError(g.config, "request for typekind: " & $kind)
g.sysTypes[kind] = result
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)

proc resetSysTypes*(g: ModuleGraph) =
Expand Down
2 changes: 1 addition & 1 deletion compiler/semmagic.nim
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ proc evalTypeTrait(c: PContext; traitCall: PNode, operand: PType, context: PSym)
newTypeWithSons(context, kind, sons).toNode(traitCall.info)

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
case s
Expand Down
6 changes: 3 additions & 3 deletions koch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ proc csource(args: string) =

proc bundleC2nim(args: string) =
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",
options = "--noNimblePath --path:. " & args)

proc bundleNimbleExe(latest: bool, args: string) =
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:
withDir("dist/nimble"):
exec("git fetch")
Expand All @@ -152,7 +152,7 @@ proc buildNimble(latest: bool, args: string) =
while dirExists("dist/nimble" & $id):
inc 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):
if latest:
exec("git checkout -f master")
Expand Down
2 changes: 1 addition & 1 deletion tests/metatype/ttypetraits.nim
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ block genericParams:
# bug 13095

type
CpuStorage{.shallow.}[T] = ref object
CpuStorage[T] {.shallow.} = ref object
when supportsCopyMem(T):
raw_buffer*: ptr UncheckedArray[T] # 8 bytes
memalloc*: pointer # 8 bytes
Expand Down
2 changes: 1 addition & 1 deletion tools/ci_testresults.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os, json, sets, strformat

const skip = toSet(["reDisabled", "reIgnored", "reSuccess", "reJoined"])
const skip = toHashSet(["reDisabled", "reIgnored", "reSuccess", "reJoined"])

when isMainModule:
for fn in walkFiles("testresults/*.json"):
Expand Down