<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px">> </span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">Any idea on how to fix that? #caseError must not be sent to "self" if inlined:</span><br>
</p>
<p><br>
</p>
<p>See <span>Compiler-nice.427 (inbox) and <span>caseerror.1.cs (<a href="http://forum.world.st/Problems-with-caseError-tp5111930p5112255.html" class="OWAAutoLink" id="LPlnk849689" previewremoved="true">http://forum.world.st/Problems-with-caseError-tp5111930p5112255.html</a>).
 What a mess. *sigh* :-)</span><br>
</span></p>
<p><span><span><br>
</span></span></p>
<p><span><span>Best,</span></span></p>
<p><span><span>Christoph</span></span></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody"><span style="font-size:12pt"></span>
<div><br>
</div>
</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Freitag, 17. April 2020 10:10:30<br>
<b>An:</b> gettimothy via Squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Trunk: Tests-mt.430.mcz</font>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size:10pt; font-family:Arial; color:#000000">
Hi all!
<div><br>
</div>
<div>Any idea on how to fix that? #caseError must not be sent to "self" if inlined:</div>
<div><br>
</div>
<div><img naturalheight="343" naturalwidth="548" id="01bee8ac-4a1d-4356-af49-ee80a3a692d1" width="auto" style="user-select: none;" src="cid:8cfca4c8-4bf7-44c9-ab78-715b19fe2135"><br>
</div>
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style:solid; border-width:1px; margin-top:20px; margin-left:0px; padding-left:10px; min-width:500px">
<p style="color:#AAAAAA; margin-top:10px">Am 17.04.2020 10:00:17 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">Marcel Taeumel uploaded a new version of Tests to project The Trunk:<br>
http://source.squeak.org/trunk/Tests-mt.430.mcz<br>
<br>
==================== Summary ====================<br>
<br>
Name: Tests-mt.430<br>
Author: mt<br>
Time: 17 April 2020, 10:00:04.765586 am<br>
UUID: f6a52e06-a24a-ca4b-bbea-8cf479934e4a<br>
Ancestors: Tests-ul.429<br>
<br>
First steps to improve CaseErrorTest:<br>
- the faulty #printOn: must be in a separate object so that the instance of TestCase can be printed as usual in logs and views<br>
- adds #testCaseErrorMessage, which actually documents another bug, which is that #printString in #caseError is called on the wrong object<br>
<br>
I suppose that the idea of having "self printString" in #caseError is that the user learns about the actual cases of the receiver *and not* about the outer-context object that is triggering that case-of in the first place.<br>
<br>
=============== Diff against Tests-ul.429 ===============<br>
<br>
Item was removed:<br>
- ----- Method: CaseErrorTest>>printOn: (in category 'tests') -----<br>
- printOn: aStream<br>
- 3 caseOf: <br>
- { [1] -> [aStream nextPutAll: 'option 1'].<br>
- [2] -> [aStream nextPutAll: 'option 2'] }<br>
- "caseError in printOn:"!<br>
<br>
Item was changed:<br>
----- Method: CaseErrorTest>>testCaseErrorInPrintOn (in category 'tests') -----<br>
testCaseErrorInPrintOn<br>
+ self should: [ CaseErrorTestObject new printString ] raise: Error!<br>
- self should: [ self printString ] raise: Error!<br>
<br>
Item was added:<br>
+ ----- Method: CaseErrorTest>>testCaseErrorMessage (in category 'tests') -----<br>
+ testCaseErrorMessage<br>
+ "Check whether the error message actually includes the printString of the object where #caseOf: is sent to. As of April 17, 2020, the error message actually uses the printString of the outer-contxt receiver, which is wrong. Take a look at Object >> #caseOf:.
 There is no indication of 'self' not being the receiver of #caseOf:."<br>
+ <br>
+ ['my message' caseOf: { [1] -> ['option 1'] }]<br>
+ on: Error<br>
+ do: [:error | self assert: (error messageText includesSubstring: 'my message' printString)].!<br>
<br>
Item was added:<br>
+ Object subclass: #CaseErrorTestObject<br>
+ instanceVariableNames: ''<br>
+ classVariableNames: ''<br>
+ poolDictionaries: ''<br>
+ category: 'Tests-Bugs'!<br>
<br>
Item was added:<br>
+ ----- Method: CaseErrorTestObject>>printOn: (in category 'printing') -----<br>
+ printOn: aStream<br>
+ 3 caseOf: <br>
+ { [1] -> [aStream nextPutAll: 'option 1'].<br>
+ [2] -> [aStream nextPutAll: 'option 2'] }<br>
+ "caseError in printOn:"!<br>
<br>
<br>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>