Skip to content

Commit

Permalink
This fixes #3211 by making sure to recompile all methods that use the…
Browse files Browse the repository at this point in the history
… class. We can just use #usingMethods, as the class builder has already made sure that the class binding (the Global Variable) is the correct one.
  • Loading branch information
MarcusDenker committed Jun 3, 2021
1 parent 94b3690 commit 894a089
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/OpalCompiler-Core/OCUndeclaredVariableWarning.class.st
Expand Up @@ -90,7 +90,7 @@ OCUndeclaredVariableWarning >> defaultAction [
OCUndeclaredVariableWarning >> defineClass: className [
"Prompts the user to define a new class."

| classSymbol systemCategory classDefinition |
| classSymbol systemCategory classDefinition classBinding |
classSymbol := className asSymbol.
systemCategory := self methodClass category
ifNil: [ 'Unknown' ].
Expand All @@ -108,8 +108,10 @@ OCUndeclaredVariableWarning >> defineClass: className [
source: classDefinition;
logged: true;
evaluate.
^ (node owningScope lookupVar: className)
ifNil: [self error: 'should be not happen']
classBinding := node owningScope lookupVar: className.
"make sure to recompile all methods referencing this class"
classBinding usingMethods do: [:method | method recompile].
^classBinding
]

{ #category : #correcting }
Expand Down

0 comments on commit 894a089

Please sign in to comment.