mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-02 01:48:00 +00:00
Merge branch 'devel' into araq-fixes-7833
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -58,6 +58,7 @@ dist/
|
||||
.*/
|
||||
~*
|
||||
|
||||
# testament cruft
|
||||
# testament cruft; TODO: generate these in a gitignore'd dir in the first place.
|
||||
testresults/
|
||||
test.txt
|
||||
/test.ini
|
||||
|
||||
@@ -2127,7 +2127,7 @@ proc semSetConstr(c: PContext, n: PNode): PNode =
|
||||
n.sons[i] = semExprWithType(c, n.sons[i])
|
||||
if typ == nil:
|
||||
typ = skipTypes(n.sons[i].typ, {tyGenericInst, tyVar, tyLent, tyOrdinal, tyAlias, tySink})
|
||||
if not isOrdinalType(typ):
|
||||
if not isOrdinalType(typ, allowEnumWithHoles=true):
|
||||
localError(c.config, n.info, errOrdinalTypeExpected)
|
||||
typ = makeRangeType(c, 0, MaxSetElements-1, n.info)
|
||||
elif lengthOrd(c.config, typ) > MaxSetElements:
|
||||
|
||||
8
koch.nim
8
koch.nim
@@ -242,7 +242,15 @@ proc zip(args: string) =
|
||||
exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim zip compiler/installer.ini" %
|
||||
["tools/niminst/niminst".exe, VersionAsString])
|
||||
|
||||
proc ensureCleanGit() =
|
||||
let (outp, status) = osproc.execCmdEx("git diff")
|
||||
if outp.len != 0:
|
||||
quit "Not a clean git repository; 'git diff' not empty!"
|
||||
if status != 0:
|
||||
quit "Not a clean git repository; 'git diff' returned non-zero!"
|
||||
|
||||
proc xz(args: string) =
|
||||
ensureCleanGit()
|
||||
bundleNimbleSrc()
|
||||
bundleNimsuggest(false)
|
||||
nimexec("cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" %
|
||||
|
||||
@@ -417,12 +417,18 @@ proc setStdIoUnbuffered() =
|
||||
discard c_setvbuf(stdin, nil, IONBF, 0)
|
||||
|
||||
when declared(stdout):
|
||||
when defined(windows) and compileOption("threads"):
|
||||
var echoLock: SysLock
|
||||
initSysLock echoLock
|
||||
|
||||
proc echoBinSafe(args: openArray[string]) {.compilerProc.} =
|
||||
# flockfile deadlocks some versions of Android 5.x.x
|
||||
when not defined(windows) and not defined(android) and not defined(nintendoswitch):
|
||||
proc flockfile(f: File) {.importc, noDecl.}
|
||||
proc funlockfile(f: File) {.importc, noDecl.}
|
||||
flockfile(stdout)
|
||||
when defined(windows) and compileOption("threads"):
|
||||
acquireSys echoLock
|
||||
for s in args:
|
||||
discard c_fwrite(s.cstring, s.len, 1, stdout)
|
||||
const linefeed = "\n" # can be 1 or more chars
|
||||
@@ -430,5 +436,7 @@ when declared(stdout):
|
||||
discard c_fflush(stdout)
|
||||
when not defined(windows) and not defined(android) and not defined(nintendoswitch):
|
||||
funlockfile(stdout)
|
||||
when defined(windows) and compileOption("threads"):
|
||||
releaseSys echoLock
|
||||
|
||||
{.pop.}
|
||||
|
||||
@@ -205,4 +205,12 @@ echo warnUninit in gNotes
|
||||
|
||||
# 7555
|
||||
doAssert {-1.int8, -2, -2}.card == 2
|
||||
doAssert {1, 2, 2, 3..5, 4..6}.card == 6
|
||||
doAssert {1, 2, 2, 3..5, 4..6}.card == 6
|
||||
|
||||
type Foo = enum
|
||||
Foo1 = 0
|
||||
Foo2 = 1
|
||||
Foo3 = 3
|
||||
|
||||
let x = { Foo1, Foo2 }
|
||||
# bug #8425
|
||||
|
||||
Reference in New Issue
Block a user