* fix #16898
* fix #17621

* Update compiler/semtypes.nim
This commit is contained in:
flywind 2021-04-07 00:01:54 +08:00 • committed by GitHub
commit e406e28738
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 52 additions and 3 deletions

View file

@ -57,7 +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 t.kind == tyLent and kind != skResult and (views notin c.features):
elif t.kind == tyLent and ((kind != skResult and views notin c.features) or
kind == skParam): # lent can't be used as parameters.
result = t
else:
var t2 = skipTypes(t[0], abstractInst-{tyTypeDesc, tySink})