--- a/SmallSense__SmalltalkInferencer.st Sat Oct 05 01:02:31 2013 +0100
+++ b/SmallSense__SmalltalkInferencer.st Mon Oct 07 11:11:31 2013 +0100
@@ -373,10 +373,23 @@
(rec name = 'Smalltalk' and:[anObject arguments conform:[:node | node isConstant ] ]) ifTrue:[
| result |
- result := anObject evaluate.
- result notNil ifTrue:[
- anObject inferedType: ((Type withClass: result class) trustfullness: 100)
- ].
+ "Here, evaluate the node, but only for certain known selectors!!
+ (think of selector #exit :-) - you'll laugh, but it hit me back hard
+ couple times...
+ "
+ (#( at:
+ classNamed:
+ "/ add more...
+ ) includes:anObject selector) ifTrue:[
+ [
+ result := anObject evaluate.
+ result notNil ifTrue:[
+ anObject inferedType: ((Type withClass: result class) trustfullness: 100)
+ ]
+ ] on: Error do:[
+ "/pass
+ ]
+ ]
].
] ifFalse:[
(sends at: rec name ifAbsentPut:[Set new]) add: anObject selector.
@@ -448,14 +461,18 @@
| jclass |
"/ fetch an accessor...
- jclass := anObject evaluate.
- "/ fetch the class...
- jclass := JavaVM classNamed: jclass fullName definedBy: JavaVM systemClassLoader.
- jclass notNil ifTrue:[
- anObject inferedType: (Type withClass: jclass class).
- ] ifFalse:[
- anObject inferedType: (Type withClass: JavaClass).
- ].
+ [
+ jclass := anObject evaluate.
+ "/ fetch the class...
+ jclass := JavaVM classNamed: jclass fullName definedBy: JavaVM systemClassLoader.
+ jclass notNil ifTrue:[
+ anObject inferedType: (Type withClass: jclass class).
+ ] ifFalse:[
+ anObject inferedType: (Type withClass: JavaClass).
+ ].
+ ] on: Error do:[
+ "/ ignore...
+ ]
] ifFalse:[
anObject inferedType: (Type withClass: JavaPackage).
].