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) =
|
||||
# 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
|
||||
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; " &
|
||||
"use 'owned(" & typeToString(le.typ) & ")' as the return type")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue