> On 16 Jun 2019, at 08:41, eftomi <tomaz.t...@ef.uni-lj.si> wrote:
> 
> I found the cause - I created the #buttonBad accessing methods with code
> (re)factoring (generate accessors), and in this case the accessors are made
> in this fashion:
> 
> CustomerSatisfaction >> buttonBad: *anObject
>       *buttonBad := *anObject
> 
> *It's better to use 
> 
> CustomerSatisfaction >> buttonBad: *aComposablePresenterClass
>       *buttonBad := *aComposablePresenterClass
> 
> *as this method is doing:
> 
> ComposablePresenter >> instantiate: aComposablePresenterClass
>       "Instantiate a ComposablePresenter subclass and set its instance owner"
> 
>       ^ aComposablePresenterClass owner: self
> 

Yes, the problem is that the Type guesser guesses types, but then they are used 
as
if they would be the truth…

this is done in two cases:

1) names of arguments, as you have seen: if you call it “anArray”, the code 
completion will only show you method for Array.

2) sends to Globals that are classes: every send of the kind “Class something” 
will be types as “instance of Class”. Which is not
even true for #new in all cases (see String). 

What would be better: distinguish between “types” and “type guess”. The later 
we should use to sort the results, not to restrict it.

> To find the cause, I used the debugger extensively and found the core logic
> in ECInstVarTypeGuesser >> perform method - it was quite an exercise!
> 


Wow! that is a real execise.

        Marcus

Reply via email to