--- a/SmallSense__SmalltalkInferencer.st Tue Nov 19 12:48:26 2013 +0000
+++ b/SmallSense__SmalltalkInferencer.st Tue Nov 19 13:02:56 2013 +0000
@@ -484,6 +484,42 @@
"Created: / 27-11-2011 / 15:49:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 08-10-2013 / 11:07:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitVariableNode:anObject
+
+ | t |
+
+ "Following code ensures, that all variable nodes refering same
+ variable shares the inferred type"
+ t := types at: anObject name ifAbsentPut:[Type unknown].
+ anObject inferedType: t.
+
+ anObject isGlobalVariable ifTrue:[
+ | global class |
+
+ global := Smalltalk at: anObject name asSymbol.
+ "/ Special hack for JAVA - its actually a JavaPackage...
+
+ global == (Smalltalk at: #JAVA) ifTrue:[
+ global := JavaPackage
+ ].
+ class := global class.
+
+ global notNil ifTrue:[
+ t addClass: class.
+ t trustfullness: 100.
+ ].
+ ^self.
+ ].
+ anObject isClassVariable ifTrue:[
+ t addClass: (class theNonMetaclass classVarAt: anObject name asSymbol) class.
+ t trustfullness: 100.
+ ^self.
+ ].
+
+ "Created: / 26-11-2011 / 13:31:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 26-10-2013 / 10:08:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!SmalltalkInferencer::Phase2 methodsFor:'processing'!