Skip to content

Commit 1f725f1

Browse files
authored
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
1 parent 79ec8c2 commit 1f725f1

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

.builds/freebsd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ tasks:
2222
- test: |
2323
cd Nim
2424
if ! ./koch runCI; then
25-
nim c -r tools/ci_testresults.nim
26-
exit 1
27-
fi
25+
nim c -r tools/ci_testresults.nim
26+
exit 1
27+
fi
2828
triggers:
2929
- action: email
3030
condition: failure

compiler/magicsys.nim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ proc getSysType*(g: ModuleGraph; info: TLineInfo; kind: TTypeKind): PType =
6868
of tyUInt64: result = sysTypeFromName("uint64")
6969
of tyFloat: result = sysTypeFromName("float")
7070
of tyFloat32: result = sysTypeFromName("float32")
71-
of tyFloat64: return sysTypeFromName("float64")
71+
of tyFloat64: result = sysTypeFromName("float64")
7272
of tyFloat128: result = sysTypeFromName("float128")
7373
of tyBool: result = sysTypeFromName("bool")
7474
of tyChar: result = sysTypeFromName("char")
@@ -79,7 +79,9 @@ proc getSysType*(g: ModuleGraph; info: TLineInfo; kind: TTypeKind): PType =
7979
else: internalError(g.config, "request for typekind: " & $kind)
8080
g.sysTypes[kind] = result
8181
if result.kind != kind:
82-
internalError(g.config, "wanted: " & $kind & " got: " & $result.kind)
82+
if kind == tyFloat64 and result.kind == tyFloat: discard # because of aliasing
83+
else:
84+
internalError(g.config, "wanted: " & $kind & " got: " & $result.kind)
8385
if result == nil: internalError(g.config, "type not found: " & $kind)
8486

8587
proc resetSysTypes*(g: ModuleGraph) =

compiler/semmagic.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ proc evalTypeTrait(c: PContext; traitCall: PNode, operand: PType, context: PSym)
134134
newTypeWithSons(context, kind, sons).toNode(traitCall.info)
135135

136136
if operand.kind == tyGenericParam or (traitCall.len > 2 and operand2.kind == tyGenericParam):
137-
return traitCall ## tpo early to evaluate
137+
return traitCall ## too early to evaluate
138138

139139
let s = trait.sym.name.s
140140
case s

koch.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ proc csource(args: string) =
124124

125125
proc bundleC2nim(args: string) =
126126
if not dirExists("dist/c2nim/.git"):
127-
exec("git clone https://github.com/nim-lang/c2nim.git dist/c2nim")
127+
exec("git clone -q https://github.com/nim-lang/c2nim.git dist/c2nim")
128128
nimCompile("dist/c2nim/c2nim",
129129
options = "--noNimblePath --path:. " & args)
130130

131131
proc bundleNimbleExe(latest: bool, args: string) =
132132
if not dirExists("dist/nimble/.git"):
133-
exec("git clone https://github.com/nim-lang/nimble.git dist/nimble")
133+
exec("git clone -q https://github.com/nim-lang/nimble.git dist/nimble")
134134
if not latest:
135135
withDir("dist/nimble"):
136136
exec("git fetch")
@@ -152,7 +152,7 @@ proc buildNimble(latest: bool, args: string) =
152152
while dirExists("dist/nimble" & $id):
153153
inc id
154154
installDir = "dist/nimble" & $id
155-
exec("git clone https://github.com/nim-lang/nimble.git " & installDir)
155+
exec("git clone -q https://github.com/nim-lang/nimble.git " & installDir)
156156
withDir(installDir):
157157
if latest:
158158
exec("git checkout -f master")

tests/metatype/ttypetraits.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ block genericParams:
112112
# bug 13095
113113

114114
type
115-
CpuStorage{.shallow.}[T] = ref object
115+
CpuStorage[T] {.shallow.} = ref object
116116
when supportsCopyMem(T):
117117
raw_buffer*: ptr UncheckedArray[T] # 8 bytes
118118
memalloc*: pointer # 8 bytes

tools/ci_testresults.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import os, json, sets, strformat
44

5-
const skip = toSet(["reDisabled", "reIgnored", "reSuccess", "reJoined"])
5+
const skip = toHashSet(["reDisabled", "reIgnored", "reSuccess", "reJoined"])
66

77
when isMainModule:
88
for fn in walkFiles("testresults/*.json"):

0 commit comments

Comments
 (0)