<div dir="ltr"><div>Hi,</div><div><br></div><div>No this is not a bug.</div><div><br></div>This needs to be handled in the primitive failure code in the image, the method should be something like that :<div><br><div><div><font face="monospace, monospace">Object>>instVarAt: index put: anObject</font></div><div><font face="monospace, monospace"><span style="white-space:pre">     </span><primitive: 174 error: ec></font></div><div><font face="monospace, monospace">        self isReadOnlyObject ifTrue: [(ModificationForbidden for: self atInstVar: index with: anObject) signal]</font></div><div><font face="monospace, monospace"><span style="white-space:pre">     </span>self primitiveFailed</font></div><div><br></div><div>All primitive fall-back code triggering object mutation should be rewritten this way, especially primitives such as #at:put:, #instVarAt:put:, etc.</div><div><br></div></div></div><div>Cheers</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 5, 2018 at 1:42 PM, Norbert Hartl <span dir="ltr"><<a href="mailto:norbert@hartl.name" target="_blank">norbert@hartl.name</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div style="word-wrap:break-word;line-break:after-white-space">If I do <div><br></div><div><div>(#foo -> #bar)</div><div><span class="m_-2406158539713268726Apple-tab-span" style="white-space:pre-wrap">  </span>beReadOnlyObject;</div><div><span class="m_-2406158539713268726Apple-tab-span" style="white-space:pre-wrap"> </span>value: #baz</div></div><div><br></div><div>it throws</div><div><br></div><div><b>ModificationForbidden:  #foo->#bar is read-only, hence its field 2 cannot be modified with #baz</b></div><div><br></div><div> which is as expected. But if I do</div><div><br></div><div><div>(#foo -> #bar)</div><div><span class="m_-2406158539713268726Apple-tab-span" style="white-space:pre-wrap">     </span>beReadOnlyObject;</div><div><span class="m_-2406158539713268726Apple-tab-span" style="white-space:pre-wrap"> </span>instVarNamed: #value put: #baz</div></div><div><br></div><div>I get</div><div><br></div><div><b>PrimitiveFailed: primitive #instVarAt:put: in Association failed</b></div><div><br></div><div>I think this a bug, no?</div><div><br></div><div>Norbert</div></div><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span style="font-size:12.8px">Clément Béra</span><div style="font-size:12.8px">Pharo consortium engineer</div><div style="font-size:12.8px"><a href="https://clementbera.wordpress.com/" target="_blank">https://clementbera.wordpress.com/</a><br></div><div style="font-size:12.8px"><span style="line-height:16px">Bâtiment B 40, avenue Halley 59650 </span><span style="font-weight:bold;line-height:16px">Villeneuve d'Ascq</span></div></div></div>
</div>