<div dir="ltr"><div dir="ltr">On Wed, Jul 17, 2024 at 3:50 PM <<a href="mailto:ken.dickey@whidbey.com">ken.dickey@whidbey.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On 2024-07-17 07:08, Mark Volkmann via Cuis-dev wrote:<br>
<br>
> When I enter the following lines in a Workspace, select them, and "Do <br>
> it", I get an AssertionFailure error:<br>
> <br>
> str1 := 'test'.<br>
> str2 := 'test'.<br>
> self assert: str1 ~~ str2.<br>
> <br>
> Ken, are you saying that you do not get that error?<br>
<br>
Yes.  For me `str1 ~~ str2` --> true<br>
</blockquote></div><div><br></div>Are you executing the three lines one at a time or are you selecting all three and running "Do it"?<div>Apparently when they are executed individually, the compiler doesn't optimize to make str1 and str1 refer to the same String in memory.</div><div>But when you run all the lines together, the compiler decides that they can share the object and the assertion fails.<br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div></div></div>