diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-02-08 01:43:38 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-02-08 01:43:38 +0100 |
commit | ee6a46f264d41de1d252d1b7e669b7656211a498 (patch) | |
tree | 58c34f1ceceeb500c726ec6a8463689bdb1d8ffe /compiler | |
parent | e67124ca80aa18338c0d98749537ee394ea2ce8b (diff) | |
download | Nim-ee6a46f264d41de1d252d1b7e669b7656211a498.tar.gz |
some progress on #3832
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/parampatterns.nim | 3 | ||||
-rw-r--r-- | compiler/semcall.nim | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/compiler/parampatterns.nim b/compiler/parampatterns.nim index 978583c14..f8f1f355c 100644 --- a/compiler/parampatterns.nim +++ b/compiler/parampatterns.nim @@ -182,6 +182,9 @@ proc isAssignable*(owner: PSym, n: PNode; isUnsafeAddr=false): TAssignableResult ## 'owner' can be nil! result = arNone case n.kind + of nkEmpty: + if n.typ != nil and n.typ.kind == tyVar: + result = arLValue of nkSym: let kinds = if isUnsafeAddr: {skVar, skResult, skTemp, skParam, skLet} else: {skVar, skResult, skTemp} diff --git a/compiler/semcall.nim b/compiler/semcall.nim index a0d0db3ad..eba1059ef 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -420,7 +420,13 @@ proc searchForBorrowProc(c: PContext, startScope: PScope, fn: PSym): PSym = let param = fn.typ.n.sons[i] let t = skipTypes(param.typ, abstractVar-{tyTypeDesc}) 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: var resolved = semOverloadedCall(c, call, call, {fn.kind}) if resolved != nil: |