* fixes #12642

* update important packages; refs #18804

* fixes #18805; refs #18806

* fixes a regression

* Update testament/categories.nim

Co-authored-by: flywind <xzsflywind@gmail.com>

* progress

* progress

Co-authored-by: flywind <xzsflywind@gmail.com>
This commit is contained in:
Andreas Rumpf
2021-09-06 17:43:03 +02:00
committed by GitHub
parent 90bfd34250
commit 34a53e8049
6 changed files with 36 additions and 7 deletions

View File

@@ -369,6 +369,7 @@ proc genParams(p: BProc, ri: PNode, typ: PType): Rope =
if ri[i].skipTrivialIndirections.kind == nkSym:
needTmp[i - 1] = potentialAlias(ri[i], potentialWrites)
else:
#if not ri[i].typ.isCompileTimeOnly:
var potentialReads: seq[PNode]
getPotentialReads(ri[i], potentialReads)
for n in potentialReads:

View File

@@ -174,6 +174,12 @@ proc commonType*(c: PContext; x, y: PType): PType =
result = b #.skipIntLit
elif a.kind in IntegralTypes and a.n != nil:
result = a #.skipIntLit
elif a.kind == tyProc and b.kind == tyProc:
if a.callConv == ccClosure and b.callConv != ccClosure:
result = x
elif compatibleEffects(a, b) != efCompat or
(b.flags * {tfNoSideEffect, tfGcSafe}) < (a.flags * {tfNoSideEffect, tfGcSafe}):
result = y
else:
var k = tyNone
if a.kind in {tyRef, tyPtr}:

View File

@@ -1023,8 +1023,9 @@ proc transform(c: PTransf, n: PNode): PNode =
result[0] = transform(c, n[0])
# Skip the second son since it only contains an unsemanticized copy of the
# variable type used by docgen
result[1] = n[1]
result[2] = transform(c, n[2])
let last = n.len-1
for i in 1..<last: result[i] = n[i]
result[last] = transform(c, n[last])
# XXX comment handling really sucks:
if importantComments(c.graph.config):
result.comment = n.comment

View File

@@ -459,11 +459,13 @@ proc testNimblePackages(r: var TResults; cat: Category; packageFilter: string) =
r.addResult(packageFileTest, targetC, "", "", reBuildFailed)
except JsonParsingError:
echo "[Warning] - Cannot run nimble tests: Invalid package file."
errors = 1
r.addResult(packageFileTest, targetC, "", "Invalid package file", reBuildFailed)
raise
except ValueError:
echo "[Warning] - $#" % getCurrentExceptionMsg()
errors = 1
r.addResult(packageFileTest, targetC, "", "Unknown package", reBuildFailed)
raise # bug #18805
finally:
if errors == 0: removeDir(packagesDir)

View File

@@ -114,7 +114,6 @@ pkg "nimsvg"
pkg "nimterop", "nimble minitest"
pkg "nimwc", "nim c nimwc.nim"
pkg "nimx", "nim c --threads:on test/main.nim", allowFailure = true
pkg "nimYAML", "nim c -r test/tserialization.nim"
pkg "nitter", "nim c src/nitter.nim", "https://github.com/zedeus/nitter"
pkg "norm", "nim c -r tests/sqlite/trows.nim"
pkg "npeg", "nimble testarc"
@@ -162,7 +161,7 @@ pkg "weave", "nimble test_gc_arc", allowFailure = true
pkg "websocket", "nim c websocket.nim"
pkg "winim", allowFailure = true
pkg "with"
pkg "ws"
pkg "yaml", "nim build"
pkg "ws", allowFailure = true
pkg "yaml", "nim c -r test/tserialization.nim"
pkg "zero_functional", "nim c -r -d:nimNoLentIterators test.nim"
pkg "zippy"

View File

@@ -34,3 +34,23 @@ proc use*() =
use()
# bug #12642
import os
proc raises() {.raises: Exception.} = discard
proc harmless() {.raises: [].} = discard
let x = if paramStr(1) == "true": harmless else: raises
let
choice = 0
proc withoutSideEffects(): int = 0
proc withSideEffects(): int = echo "foo" # the echo causes the side effect
let procPtr = case choice
of 0: withoutSideEffects
else: withSideEffects
echo procPtr.repr