ORC: cursor inference bugfix (#17973)

* fixed a .cursor inference bug

* added a test case
This commit is contained in:
Andreas Rumpf 2021-05-08 16:47:06 +02:00 • committed by GitHub
commit c14427dbf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 5 deletions

View file

@ -695,7 +695,7 @@ proc traverse(c: var Partitions; n: PNode) =
# 'paramType[0]' is still a view type, this is not a typo!
if directViewType(paramType[0]) == noView and classifyViewType(paramType[0]) != noView:
borrowingCall(c, paramType[0], n, i)
elif borrowChecking in c.goals and m == mNone:
elif m == mNone:
potentialMutationViaArg(c, n[i], parameters)
of nkAddr, nkHiddenAddr:
@ -921,4 +921,4 @@ proc computeCursors*(s: PSym; n: PNode; g: ModuleGraph) =
discard "cannot cursor into a graph that is mutated"
else:
v.sym.flags.incl sfCursor
#echo "this is now a cursor ", v.sym, " ", par.s[rid].flags, " ", config $ v.sym.info
#echo "this is now a cursor ", v.sym, " ", par.s[rid].flags, " ", g.config $ v.sym.info