Fixes 6544 (#9427)

* Fix call to converters with var/lent args

Fixes #6544

* Fix printing of lent types

* lent is only valid for result types
This commit is contained in:
LemonBoy 2018-10-19 21:04:32 +02:00 • committed by Andreas Rumpf
commit 16a70c84aa
3 changed files with 20 additions and 1 deletions

View file

@ -397,7 +397,7 @@ const
"float", "float32", "float64", "float128",
"uint", "uint8", "uint16", "uint32", "uint64",
"opt", "sink",
"lent", "varargs[$1]", "UncheckedArray[$1]", "Error Type",
"lent ", "varargs[$1]", "UncheckedArray[$1]", "Error Type",
"BuiltInTypeClass", "UserTypeClass",
"UserTypeClassInst", "CompositeTypeClass", "inferred",
"and", "or", "not", "any", "static", "TypeFromExpr", "FieldAccessor",
@ -1176,6 +1176,7 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind,
case t.kind
of tyVar, tyLent:
if kind in {skProc, skFunc, skConst}: return t
elif t.kind == tyLent and kind != skResult: return t
var t2 = skipTypes(t.sons[0], abstractInst-{tyTypeDesc})
case t2.kind
of tyVar, tyLent: