out parameters: enforce that 'out' is only used as a parameter (#20510)
* out parameters: enforce that 'out' is only used as a parameter * make tables.nim use 'out' parameters * better backwards compat
This commit is contained in:
parent
a132f5502a
commit
e83f27e6a0
5 changed files with 47 additions and 3 deletions
|
|
@ -65,6 +65,8 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind,
|
|||
elif t.kind == tyLent and ((kind != skResult and views notin c.features) or
|
||||
kind == skParam): # lent can't be used as parameters.
|
||||
result = t
|
||||
elif isOutParam(t) and kind != skParam:
|
||||
result = t
|
||||
else:
|
||||
var t2 = skipTypes(t[0], abstractInst-{tyTypeDesc, tySink})
|
||||
case t2.kind
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue