Warning when duplicate instance variables

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

Warning when duplicate instance variables

MrGwen
Hi,

It's possible by mistake to create a class with duplicate instance
variable, the following patch checks and warms the user. I plan to
do the same but for duplicate methods defined on a class.

Gwen

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk

0001-duplicate-instance-variables.patch (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Warning when duplicate instance variables

Paolo Bonzini-2
On 07/29/2011 06:13 PM, Gwenael Casaccio wrote:
> It's possible by mistake to create a class with duplicate instance
> variable, the following patch checks and warms the user.

Is it done also when the first name is in the superclass?  I'm not sure
I'd like that (ANSI says it must not be an error BTW).

 > I plan to
> do the same but for duplicate methods defined on a class.

Nice, you can do that in the parser too.  Much more useful, actually!

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Warning when duplicate instance variables

MrGwen
On 29/07/2011 18:35, Paolo Bonzini wrote:
> On 07/29/2011 06:13 PM, Gwenael Casaccio wrote:
>> It's possible by mistake to create a class with duplicate instance
>> variable, the following patch checks and warms the user.
>
> Is it done also when the first name is in the superclass?  I'm not
> sure I'd like that (ANSI says it must not be an error BTW).
>

It's done for super and sub classes. I understand but this is just a
warning here, and I've made it because
the developer - here me :) - can loose a "lot" of time because of such
kind of simple bug.

> > I plan to
>> do the same but for duplicate methods defined on a class.
>
> Nice, you can do that in the parser too.  Much more useful, actually!
>
> Paolo



_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk