Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in Iceberg when removing selectors from anonymous classes #760

Open
guillep opened this issue May 3, 2018 · 0 comments
Open
Labels

Comments

@guillep
Copy link
Member

guillep commented May 3, 2018

From mailing list

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?

@guillep guillep added the bug label May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant