fixes 'lent T' inside object constructor [backport] (#18911)
* fixes 'lent T' inside object constructor [backport] * progress
This commit is contained in:
parent
cdf9ac675b
commit
576fece909
4 changed files with 21 additions and 3 deletions
|
|
@ -107,12 +107,13 @@ proc fitNode(c: PContext, formal: PType, arg: PNode; info: TLineInfo): PNode =
|
|||
else:
|
||||
result = fitNodePostMatch(c, formal, result)
|
||||
|
||||
proc fitNodeForLocalVar(c: PContext, formal: PType, arg: PNode; info: TLineInfo): PNode =
|
||||
proc fitNodeConsiderViewType(c: PContext, formal: PType, arg: PNode; info: TLineInfo): PNode =
|
||||
let a = fitNode(c, formal, arg, info)
|
||||
if formal.kind in {tyVar, tyLent}:
|
||||
#classifyViewType(formal) != noView:
|
||||
result = newNodeIT(nkHiddenAddr, a.info, formal)
|
||||
result.add a
|
||||
formal.flags.incl tfVarIsPtr
|
||||
else:
|
||||
result = a
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue