diff options
author | Araq <rumpf_a@web.de> | 2018-11-19 11:28:06 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-11-19 11:28:06 +0100 |
commit | 2418d0cac50642131d2b3350ededf2b3a1bd2b1d (patch) | |
tree | 14f242c034dd89a13566e37cc2a92af8f0abaf36 | |
parent | 6c7abe6e5b9ff46fdf024e471091799361fb387f (diff) | |
download | Nim-2418d0cac50642131d2b3350ededf2b3a1bd2b1d.tar.gz |
fixes #9743
-rw-r--r-- | compiler/semexprs.nim | 3 | ||||
-rw-r--r-- | tests/destructor/texplicit_move.nim | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 3d77ae524..9433a7327 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -614,7 +614,8 @@ proc analyseIfAddressTakenInCall(c: PContext, n: PNode) = const FakeVarParams = {mNew, mNewFinalize, mInc, ast.mDec, mIncl, mExcl, mSetLengthStr, mSetLengthSeq, mAppendStrCh, mAppendStrStr, mSwap, - mAppendSeqElem, mNewSeq, mReset, mShallowCopy, mDeepCopy} + mAppendSeqElem, mNewSeq, mReset, mShallowCopy, mDeepCopy, mMove, + mWasMoved} # get the real type of the callee # it may be a proc var with a generic alias type, so we skip over them diff --git a/tests/destructor/texplicit_move.nim b/tests/destructor/texplicit_move.nim index 6735ac75d..230f0b133 100644 --- a/tests/destructor/texplicit_move.nim +++ b/tests/destructor/texplicit_move.nim @@ -2,7 +2,10 @@ discard """ output: '''3 0 -destroyed!''' +0 +10 +destroyed! +''' """ type @@ -17,3 +20,10 @@ var x.f = 3 echo move(x.f) echo x.f + +# bug #9743 +let a = create int +a[] = 10 +var b = move a[] +echo a[] +echo b |