summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-02-07 07:37:40 -0800
committerGitHub <noreply@github.com>2020-02-07 16:37:40 +0100
commit1f725f1d7e05c28a8465b55b65a538408707e3e3 (patch)
treefc8c66988e5c983fe4c13e4ebf5a8a1caa485a16
parent79ec8c257183e01c01811a34e3930de7814756fb (diff)
downloadNim-1f725f1d7e05c28a8465b55b65a538408707e3e3.tar.gz
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
-rw-r--r--.builds/freebsd.yml6
-rw-r--r--compiler/magicsys.nim6
-rw-r--r--compiler/semmagic.nim2
-rw-r--r--koch.nim6
-rw-r--r--tests/metatype/ttypetraits.nim2
-rw-r--r--tools/ci_testresults.nim2
6 files changed, 13 insertions, 11 deletions
diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml
index 73704598f..7810e39af 100644
--- a/.builds/freebsd.yml
+++ b/.builds/freebsd.yml
@@ -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
diff --git a/compiler/magicsys.nim b/compiler/magicsys.nim
index 73eacc2d6..bc3d7434b 100644
--- a/compiler/magicsys.nim
+++ b/compiler/magicsys.nim
@@ -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")
@@ -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) =
diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim
index 41a920371..30ff73d7f 100644
--- a/compiler/semmagic.nim
+++ b/compiler/semmagic.nim
@@ -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
diff --git a/koch.nim b/koch.nim
index 02991d4d4..e3b743c44 100644
--- a/koch.nim
+++ b/koch.nim
@@ -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")
@@ -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")
diff --git a/tests/metatype/ttypetraits.nim b/tests/metatype/ttypetraits.nim
index 2b474ba7f..c4fb9beef 100644
--- a/tests/metatype/ttypetraits.nim
+++ b/tests/metatype/ttypetraits.nim
@@ -112,7 +112,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
diff --git a/tools/ci_testresults.nim b/tools/ci_testresults.nim
index 3201606d7..8c407d6d9 100644
--- a/tools/ci_testresults.nim
+++ b/tools/ci_testresults.nim
@@ -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"):