an owned ref parameter behaves as a 'sink' parameter

This commit is contained in:
Andreas Rumpf 2019-04-07 23:11:37 +02:00
commit b2898cd254
3 changed files with 11 additions and 11 deletions

View file

@ -1812,6 +1812,12 @@ template detailedInfo*(sym: PSym): string =
proc isInlineIterator*(s: PSym): bool {.inline.} =
s.kind == skIterator and s.typ.callConv != ccClosure
proc isSinkParam*(s: PSym): bool {.inline.} =
s.kind == skParam and (s.typ.kind == tySink or tfHasOwned in s.typ.flags)
proc isSinkType*(t: PType): bool {.inline.} =
t.kind == tySink or tfHasOwned in t.flags
proc newProcType*(info: TLineInfo; owner: PSym): PType =
result = newType(tyProc, owner)
result.n = newNodeI(nkFormalParams, info)