Redeclaration of instance variables

Project:GNU Smalltalk
Component:VM
Category:bug
Priority:minor
Assigned:Unassigned
Status:active
Description

If an IVar is redefined on a superclass there are no
compilation error.

Object subclass: Foo [
| a b c |
]

Foo subclass: Bar [
| b c d |
]

Foo indexOfInstVar: 'b' => 2

Bar indexOfInstVar: 'b' => 4

Updates

#1 submitted by Paolo Bonzini on Fri, 12/10/2010 - 11:31

Note that an error would be wrong. A warning would be correct.

The only tricky part is that doing this in the C parser would be wrong, but doing it in Smalltalk code would likely make the warning message look "strange". Perhaps a subclass of Warning can be used.

#2 submitted by Gwenael Casaccio on Mon, 12/13/2010 - 09:57

I've made something there :

git@github.com:MrGwen/GNU-Smalltalk.git ivClass branch

User login