diff options
author | Andrii Riabushenko <cdome@bk.ru> | 2019-09-02 10:11:51 +0100 |
---|---|---|
committer | Andrii Riabushenko <cdome@bk.ru> | 2019-09-02 10:11:51 +0100 |
commit | ba18c12005ddbf4859fac3a04ebb149ee20532b0 (patch) | |
tree | a1fcd9c453530ec250bebdda6dffcfda42e3e80f /compiler | |
parent | ad82e65387f39970b0f12cbcb12d8b382236f3da (diff) | |
download | Nim-ba18c12005ddbf4859fac3a04ebb149ee20532b0.tar.gz |
sink as lvalue
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/parampatterns.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/parampatterns.nim b/compiler/parampatterns.nim index 1bd703fe8..b8f1fd832 100644 --- a/compiler/parampatterns.nim +++ b/compiler/parampatterns.nim @@ -224,14 +224,14 @@ proc isAssignable*(owner: PSym, n: PNode; isUnsafeAddr=false): TAssignableResult result = arLocalLValue else: result = arLValue - elif n.sym.kind == skParam and n.sym.typ.kind == tyVar: + elif n.sym.kind == skParam and n.sym.typ.kind in {tyVar, tySink}: result = arLValue elif n.sym.kind == skType: let t = n.sym.typ.skipTypes({tyTypeDesc}) if t.kind == tyVar: result = arStrange of nkDotExpr: let t = skipTypes(n.sons[0].typ, abstractInst-{tyTypeDesc}) - if t.kind in {tyVar, tyPtr, tyRef}: + if t.kind in {tyVar, tySink, tyPtr, tyRef}: result = arLValue elif isUnsafeAddr and t.kind == tyLent: result = arLValue @@ -242,7 +242,7 @@ proc isAssignable*(owner: PSym, n: PNode; isUnsafeAddr=false): TAssignableResult result = arDiscriminant of nkBracketExpr: let t = skipTypes(n.sons[0].typ, abstractInst-{tyTypeDesc}) - if t.kind in {tyVar, tyPtr, tyRef}: + if t.kind in {tyVar, tySink, tyPtr, tyRef}: result = arLValue elif isUnsafeAddr and t.kind == tyLent: result = arLValue |