* 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
commit 34a53e8049
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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: if ri[i].skipTrivialIndirections.kind == nkSym:
needTmp[i - 1] = potentialAlias(ri[i], potentialWrites) needTmp[i - 1] = potentialAlias(ri[i], potentialWrites)
else: else:
#if not ri[i].typ.isCompileTimeOnly:
var potentialReads: seq[PNode] var potentialReads: seq[PNode]
getPotentialReads(ri[i], potentialReads) getPotentialReads(ri[i], potentialReads)
for n in potentialReads: for n in potentialReads:

View file

@ -174,6 +174,12 @@ proc commonType*(c: PContext; x, y: PType): PType =
result = b #.skipIntLit result = b #.skipIntLit
elif a.kind in IntegralTypes and a.n != nil: elif a.kind in IntegralTypes and a.n != nil:
result = a #.skipIntLit 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: else:
var k = tyNone var k = tyNone
if a.kind in {tyRef, tyPtr}: 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]) result[0] = transform(c, n[0])
# Skip the second son since it only contains an unsemanticized copy of the # Skip the second son since it only contains an unsemanticized copy of the
# variable type used by docgen # variable type used by docgen
result[1] = n[1] let last = n.len-1
result[2] = transform(c, n[2]) for i in 1..<last: result[i] = n[i]
result[last] = transform(c, n[last])
# XXX comment handling really sucks: # XXX comment handling really sucks:
if importantComments(c.graph.config): if importantComments(c.graph.config):
result.comment = n.comment result.comment = n.comment

View file

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

View file

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

View file

@ -34,3 +34,23 @@ proc use*() =
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