some progress on #3832
This commit is contained in:
parent
e67124ca80
commit
ee6a46f264
2 changed files with 10 additions and 1 deletions
|
|
@ -182,6 +182,9 @@ proc isAssignable*(owner: PSym, n: PNode; isUnsafeAddr=false): TAssignableResult
|
||||||
## 'owner' can be nil!
|
## 'owner' can be nil!
|
||||||
result = arNone
|
result = arNone
|
||||||
case n.kind
|
case n.kind
|
||||||
|
of nkEmpty:
|
||||||
|
if n.typ != nil and n.typ.kind == tyVar:
|
||||||
|
result = arLValue
|
||||||
of nkSym:
|
of nkSym:
|
||||||
let kinds = if isUnsafeAddr: {skVar, skResult, skTemp, skParam, skLet}
|
let kinds = if isUnsafeAddr: {skVar, skResult, skTemp, skParam, skLet}
|
||||||
else: {skVar, skResult, skTemp}
|
else: {skVar, skResult, skTemp}
|
||||||
|
|
|
||||||
|
|
@ -420,7 +420,13 @@ proc searchForBorrowProc(c: PContext, startScope: PScope, fn: PSym): PSym =
|
||||||
let param = fn.typ.n.sons[i]
|
let param = fn.typ.n.sons[i]
|
||||||
let t = skipTypes(param.typ, abstractVar-{tyTypeDesc})
|
let t = skipTypes(param.typ, abstractVar-{tyTypeDesc})
|
||||||
if t.kind == tyDistinct or param.typ.kind == tyDistinct: hasDistinct = true
|
if t.kind == tyDistinct or param.typ.kind == tyDistinct: hasDistinct = true
|
||||||
call.add(newNodeIT(nkEmpty, fn.info, t.baseOfDistinct))
|
var x: PType
|
||||||
|
if param.typ.kind == tyVar:
|
||||||
|
x = newTypeS(tyVar, c)
|
||||||
|
x.addSonSkipIntLit t.baseOfDistinct
|
||||||
|
else:
|
||||||
|
x = t.baseOfDistinct
|
||||||
|
call.add(newNodeIT(nkEmpty, fn.info, x))
|
||||||
if hasDistinct:
|
if hasDistinct:
|
||||||
var resolved = semOverloadedCall(c, call, call, {fn.kind})
|
var resolved = semOverloadedCall(c, call, call, {fn.kind})
|
||||||
if resolved != nil:
|
if resolved != nil:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue