fixes #9743
This commit is contained in:
parent
6c7abe6e5b
commit
2418d0cac5
2 changed files with 13 additions and 2 deletions
|
|
@ -614,7 +614,8 @@ proc analyseIfAddressTakenInCall(c: PContext, n: PNode) =
|
||||||
const
|
const
|
||||||
FakeVarParams = {mNew, mNewFinalize, mInc, ast.mDec, mIncl, mExcl,
|
FakeVarParams = {mNew, mNewFinalize, mInc, ast.mDec, mIncl, mExcl,
|
||||||
mSetLengthStr, mSetLengthSeq, mAppendStrCh, mAppendStrStr, mSwap,
|
mSetLengthStr, mSetLengthSeq, mAppendStrCh, mAppendStrStr, mSwap,
|
||||||
mAppendSeqElem, mNewSeq, mReset, mShallowCopy, mDeepCopy}
|
mAppendSeqElem, mNewSeq, mReset, mShallowCopy, mDeepCopy, mMove,
|
||||||
|
mWasMoved}
|
||||||
|
|
||||||
# get the real type of the callee
|
# get the real type of the callee
|
||||||
# it may be a proc var with a generic alias type, so we skip over them
|
# it may be a proc var with a generic alias type, so we skip over them
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,10 @@
|
||||||
discard """
|
discard """
|
||||||
output: '''3
|
output: '''3
|
||||||
0
|
0
|
||||||
destroyed!'''
|
0
|
||||||
|
10
|
||||||
|
destroyed!
|
||||||
|
'''
|
||||||
"""
|
"""
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
@ -17,3 +20,10 @@ var
|
||||||
x.f = 3
|
x.f = 3
|
||||||
echo move(x.f)
|
echo move(x.f)
|
||||||
echo x.f
|
echo x.f
|
||||||
|
|
||||||
|
# bug #9743
|
||||||
|
let a = create int
|
||||||
|
a[] = 10
|
||||||
|
var b = move a[]
|
||||||
|
echo a[]
|
||||||
|
echo b
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue