<div dir="ltr"><div dir="ltr">On Tue, Apr 30, 2024 at 8:13 AM Eirik Bjørsnøs <<a href="mailto:eirbjo@gmail.com" target="_blank">eirbjo@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">     Complex withReal(double re) { return this with { <a href="http://this.re" target="_blank">this.re</a> = re; }; }</blockquote></div></blockquote><div><br></div><div>Although perhaps it would be strange if "this" refers to the origin record in the origin expression, then switches to refer to the derived record in the transformation statement?</div><div><br></div><div>In a plain old setter, we could use "<a href="http://this.re">this.re</a> = re" as an escape hatch to avoid shadowing of parameters, but if "this doesn't work like that" inside a transformation block, perhaps our only way out is to rename parameters/locals to avoid shadowing?</div><div><br></div><div>Eirik.  <br></div></div></div>