Hi.

try these expressions in playground:

10 ifTrue: [ #falseResult ]. "=>DNU #ifFalse".


10 ifTrue: [ #falseResult. ]. #unexpectedResult. "=> #unexpectedResult"

10 ifTrue: [ #falseResult asString]. #unexpectedResult. "=> DNU #ifTrue:"


Same happen with ifFalse: and ifTrue:ifFalse couples.

If you look at bytecode you will not see any jumps in not failing cases.
Probably such code is redundant because it not produce any behaviour.
It start to work properly as soon as there is any assignment or message
send around.
But it is really strange from first look.
Also it means that special boolean objects with own ifTrue:ifFalse
implementation will not receive messages in such cases.

I am not sure if it is a bug

Reply via email to