Skip to content

Commit

Permalink
when suggesting a temp, use all possible args and temps accessible in…
Browse files Browse the repository at this point in the history
… the block, not just the temps of the method

fixes pharo-project#6811
  • Loading branch information
MarcusDenker committed Jul 10, 2020
1 parent a2ba9b1 commit 82bd982
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/OpalCompiler-Core/OCUndeclaredVariableWarning.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,12 @@ OCUndeclaredVariableWarning >> possibleVariablesFor: proposedVariable [
| results class |
class := node methodNode methodClass .

results := proposedVariable correctAgainst: node temporaryVariables
results := proposedVariable correctAgainst: node methodOrBlockNode scope allTempNames
continuedFrom: nil.
proposedVariable first canBeGlobalVarInitial ifTrue:
[ results := class possibleVariablesFor: proposedVariable
continuedFrom: results ].
^ proposedVariable correctAgainst: nil continuedFrom: results.

^ proposedVariable correctAgainst: nil continuedFrom: results
]

{ #category : #correcting }
Expand Down

0 comments on commit 82bd982

Please sign in to comment.