an owned ref parameter behaves as a 'sink' parameter
This commit is contained in:
parent
f08e90f0d6
commit
b2898cd254
3 changed files with 11 additions and 11 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue