fixes #16617 [backport] (#19300)

(cherry picked from commit ac37eed5a2)
This commit is contained in:
Andreas Rumpf
2021-12-31 09:21:30 +01:00
committed by narimiran
parent afa4bc34b4
commit 5f70b1ab53

View File

@@ -57,6 +57,8 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind,
of tyVar, tyLent:
if kind in {skProc, skFunc, skConst} and (views notin c.features):
result = t
elif taIsOpenArray in flags:
result = t
elif t.kind == tyLent and ((kind != skResult and views notin c.features) or
kind == skParam): # lent can't be used as parameters.
result = t