Nasty protocols bug

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

Nasty protocols bug

Chris Uppal-3
In D6 it seems to be possible to remove a method from a class even though it is
needed in order to satisfy a protocol which the class conforms to.  The class
is implicitly, and with no warning, removed from the protocol (or do I mean:
the protocol is removed from the class ?).

In D5 we were given the choice between cancelling the operation, removing the
class from the protocol, or removing the selector from the protocol.  I think
that's the correct behaviour.

Since SmalltalkSystem>>removeMethod:changes: still talks about giving that
choice, I assume the new behaviour is a bug, with something accidentally
bypassing the check.

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Nasty protocols bug

Blair McGlashan-4
"Chris Uppal" <[hidden email]> wrote in message
news:44746f4f$1$651$[hidden email]...

> In D6 it seems to be possible to remove a method from a class even though
> it is
> needed in order to satisfy a protocol which the class conforms to.  The
> class
> is implicitly, and with no warning, removed from the protocol (or do I
> mean:
> the protocol is removed from the class ?).
>
> In D5 we were given the choice between cancelling the operation, removing
> the
> class from the protocol, or removing the selector from the protocol.  I
> think
> that's the correct behaviour.
>
> Since SmalltalkSystem>>removeMethod:changes: still talks about giving that
> choice, I assume the new behaviour is a bug, with something accidentally
> bypassing the check.
>

Yes, its a bug, though in the IDE rather than the protocol system. The
underlying protocol system will maintain the invariants (which in this case
mean that the protocol is removed from the list of those supported by the
class, since the class no longer implements all the selectors). It is the
IDEs responsibility to check and prompt if this is going to happen, so it
seems this check has been bypassed or broken as you suggest.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Nasty protocols bug

Eric Taylor
In reply to this post by Chris Uppal-3
Hello Chris,

It would seem that Blair answered both of our questions.  If you recall,
you and I had a discussion about this.

Cheers,

Eric

> In D6 it seems to be possible to remove a method from a class even
> though it is needed in order to satisfy a protocol which the class
> conforms to.  The class is implicitly, and with no warning, removed
> from the protocol (or do I mean: the protocol is removed from the
> class ?).
>
> In D5 we were given the choice between cancelling the operation,
> removing the class from the protocol, or removing the selector from
> the protocol.  I think that's the correct behaviour.
>
> Since SmalltalkSystem>>removeMethod:changes: still talks about giving
> that choice, I assume the new behaviour is a bug, with something
> accidentally bypassing the check.
>
> -- chris
>