Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007851 [Squeak] Any minor always 05-21-16 20:49 04-06-18 22:21
Reporter avalmez View Status public  
Assigned To KenCausey
Priority normal Resolution no change required  
Status closed   Product Version 5.0
Summary 0007851: anAssociation >> and: not understood
Description anAssociation = otherAssociation

fails with MessageNotUnderstood Association and:
Additional Information
Attached Files

- Relationships

- Notes
(0014615 - 1230 - 1384 - 1384 - 1384 - 1384 - 1384)
nicolas cellier
04-06-18 22:21

Thanks for reporting, but there is not enough information for reproducing the failure.

I suspect that this is not a bug in the Squeak code itself, but rather in some 3rd party code.

Generally, the message #and: is not sent, but inlined by the Smalltalk Compiler so as to have faster execution. The only exception is if the argument passed to and: is not a block of code (delimited by Square brackets [ ] ).

If squared brackets have been correctly used like this
= anotherObject
    self id = anotherObject id and: [self name = anotherObject name]

but that self id = anotherObject fails to return a Boolean (for example if = is implemented with a missing return sign ^ exactly as I intentionally did in above example, it will return self), then there will be a NonBooleanReceiver exception.

To trigger a MessageNotUnderstood exception with #and: as the not understood message, one must have forgetten the square brackets, like this

= another object
    self id = anotherObject id and: self name = anotherObject name

Then the fact that it is Association (presumably, it's a class) which receives #and: means that there is yet another error cascaded.

One must send and: to a Boolean, with a block argument.

- Issue History
Date Modified Username Field Change
05-21-16 20:49 avalmez New Issue
05-21-16 20:49 avalmez Status new => assigned
05-21-16 20:49 avalmez Assigned To  => KenCausey
05-21-16 20:53 avalmez Issue Monitored: avalmez
04-06-18 22:21 nicolas cellier Note Added: 0014615
04-06-18 22:21 nicolas cellier Status assigned => closed
04-06-18 22:21 nicolas cellier Resolution open => no change required

Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
39 total queries executed.
31 unique queries executed.
Powered by Mantis Bugtracker