Hi, 

i downloaded yesterday the latest Pharo 7 and in a playground if you do:


class := Object newAnonymousSubclass. (OK)
class package. "a RPackage(_UnpackagedPackage)" (OK)
class compile: 'test ^nil'. (OK)
(class >> #test) package. "nil" (Surprising but no problem with any
pharo version since yesterday)
class removeSelector: #test. (Exception, see below)

An exception is raised in IceSystemEventListener class because the
method package is nil: 

handlePackagesChange: packages
    IceRepository registry do: [ :repository | | changed |
        changed := packages anySatisfy: [ :each | 
            repository notifyPackageModified: each name ]. "(EACH IS NIL
HERE)"
        changed ifTrue: [ 
            Iceberg announcer announce: (IceRepositoryModified for:
repository) ]] 

So to fix it, the package needs to be correctly set for each method
compiled in an anonymous class, but  should anonymous subclasses really
raise events when adding/modifying/removing methods? 

Steven. 

Reply via email to