makes koch.nim sem'check with --newruntime
This commit is contained in:
parent
f1ee36692a
commit
9f5d9d1993
3 changed files with 12 additions and 6 deletions
|
|
@ -1522,7 +1522,7 @@ proc asgnToResultVar(c: PContext, n, le, ri: PNode) {.inline.} =
|
||||||
proc asgnToResult(c: PContext, n, le, ri: PNode) =
|
proc asgnToResult(c: PContext, n, le, ri: PNode) =
|
||||||
# Special typing rule: do not allow to pass 'owned T' to 'T' in 'result = x':
|
# Special typing rule: do not allow to pass 'owned T' to 'T' in 'result = x':
|
||||||
if ri.typ != nil and ri.typ.skipTypes(abstractInst).kind == tyOwned and
|
if ri.typ != nil and ri.typ.skipTypes(abstractInst).kind == tyOwned and
|
||||||
le.typ != nil and le.typ.skipTypes(abstractInst).kind != tyOwned:
|
le.typ != nil and le.typ.skipTypes(abstractInst).kind != tyOwned and ri.kind in nkCallKinds:
|
||||||
localError(c.config, n.info, "cannot return an owned pointer as an unowned pointer; " &
|
localError(c.config, n.info, "cannot return an owned pointer as an unowned pointer; " &
|
||||||
"use 'owned(" & typeToString(le.typ) & ")' as the return type")
|
"use 'owned(" & typeToString(le.typ) & ")' as the return type")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,8 @@ type
|
||||||
id: Handle
|
id: Handle
|
||||||
else:
|
else:
|
||||||
inHandle, outHandle, errHandle: FileHandle
|
inHandle, outHandle, errHandle: FileHandle
|
||||||
inStream, outStream, errStream: Stream
|
|
||||||
id: Pid
|
id: Pid
|
||||||
|
inStream, outStream, errStream: owned(Stream)
|
||||||
exitStatus: cint
|
exitStatus: cint
|
||||||
exitFlag: bool
|
exitFlag: bool
|
||||||
options: set[ProcessOption]
|
options: set[ProcessOption]
|
||||||
|
|
@ -724,15 +724,21 @@ when defined(Windows) and not defined(useNimRtl):
|
||||||
|
|
||||||
proc inputStream(p: Process): Stream =
|
proc inputStream(p: Process): Stream =
|
||||||
streamAccess(p)
|
streamAccess(p)
|
||||||
result = newFileHandleStream(p.inHandle)
|
if p.inStream == nil:
|
||||||
|
p.inStream = newFileHandleStream(p.inHandle)
|
||||||
|
result = p.inStream
|
||||||
|
|
||||||
proc outputStream(p: Process): Stream =
|
proc outputStream(p: Process): Stream =
|
||||||
streamAccess(p)
|
streamAccess(p)
|
||||||
result = newFileHandleStream(p.outHandle)
|
if p.outStream == nil:
|
||||||
|
p.outStream = newFileHandleStream(p.outHandle)
|
||||||
|
result = p.outStream
|
||||||
|
|
||||||
proc errorStream(p: Process): Stream =
|
proc errorStream(p: Process): Stream =
|
||||||
streamAccess(p)
|
streamAccess(p)
|
||||||
result = newFileHandleStream(p.errHandle)
|
if p.errStream == nil:
|
||||||
|
p.errStream = newFileHandleStream(p.errHandle)
|
||||||
|
result = p.errStream
|
||||||
|
|
||||||
proc execCmd(command: string): int =
|
proc execCmd(command: string): int =
|
||||||
var
|
var
|
||||||
|
|
|
||||||
|
|
@ -276,7 +276,7 @@ proc newStringTable*(keyValuePairs: varargs[string],
|
||||||
inc(i, 2)
|
inc(i, 2)
|
||||||
|
|
||||||
proc newStringTable*(keyValuePairs: varargs[tuple[key, val: string]],
|
proc newStringTable*(keyValuePairs: varargs[tuple[key, val: string]],
|
||||||
mode: StringTableMode = modeCaseSensitive): StringTableRef {.
|
mode: StringTableMode = modeCaseSensitive): owned(StringTableRef) {.
|
||||||
rtlFunc, extern: "nst$1WithTableConstr".} =
|
rtlFunc, extern: "nst$1WithTableConstr".} =
|
||||||
## Creates a new string table with given `(key, value)` tuple pairs.
|
## Creates a new string table with given `(key, value)` tuple pairs.
|
||||||
##
|
##
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue