Does RoelTyper works?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Does RoelTyper works?

Juraj Kubelka-5
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Does RoelTyper works?

Stephan Eggermont-3
Aren't you supposed to have an instance of AMock around?

Stephan


Reply | Threaded
Open this post in threaded view
|

Re: Does RoelTyper works?

camille teruel
In reply to this post by Juraj Kubelka-5
Hello Juraj,

RoelTyper guesses types from message sends mainly.
In your example, there is no message sent to the iv 'color' so it has not enough information to guess it's type.
The rule of thumb is the more code you have the more precise the type inference is.
RoelTyper can also guess types from assignments but it's limited.
It can guess the type of the right-hand expression of an assignment:
- if it's a global or a literal the type is known statically.
- if it's a message send to a class and if the corresponding method is classified under 'instance-creation' it assumes that the type is the class. In your example it doesn't do that assumption since #black is categorized under 'defaults'.
There is maybe some other cases that I don't remember.

Cheers,
Camille
 
On 19 août 2014, at 21:42, Juraj Kubelka <[hidden email]> wrote:

> Hi,
>
> I play with RoelTyper, but it does not work as I expect. I have a simple class:
>
> -=-=-=-
> Object subclass: #AMock
> instanceVariableNames: 'color'
> classVariableNames: ''
> poolDictionaries: ''
> category: 'JK-Mocks’
> -=-=-=-
>
> with method:
>
> -=-=-=-
> initialize
> super initialize.
> color := Color black.
> -=-=-=-
>
> When the following command is evaluated:  (TypeCollector typeInstvar: #color ofClass: AMock) types
> RoelTyper returns "an OrderedCollection(Object)”
>
> I expected Color.
>
> Do I miss something?
> Thanks,
> Juraj


Reply | Threaded
Open this post in threaded view
|

Re: Does RoelTyper works?

Juraj Kubelka-5
CONTENTS DELETED
The author has deleted this message.