On Wed, Mar 28, 2012 at 8:12 AM, Stéphane Ducasse
<[email protected]> wrote:
> thanks for the report. To me it looks like we changed some on classVar lookup 
> and it is not modular anymore…

I don't really know enough about the system to judge whether the
compiler is being over-conservative in this case.

A minimal case to reproduce the same error is:

Smalltalk at: #Foo put: #Foo.

Then define a class:

Object subclass: #FooTest
        instanceVariableNames: ''
        classVariableNames: 'Foo'     "This is the trigger"
        poolDictionaries: ''
        category: 'ClassVar-Testing'

On save, a debug window with "DuplicatedVariableError: Foo is defined
elsewhere" is shown.

I've tried this with a selection of images in the 1.4 set from
14400-14414 and with 1.3 13315 with the same results.  It seems that
Class>>declare: calls Class>>bindingOf: to check if a symbol is
already bound, and this always returns non-nil for globals.

Martin

Reply via email to