<div dir="ltr">On 23 June 2017 at 18:31, Tony Allevato <span dir="ltr">&lt;<a href="mailto:tony.allevato@gmail.com" target="_blank">tony.allevato@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_extra"><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"><div dir="ltr"><div class="gmail_quote"><span class="gmail-"><div dir="ltr"><br></div></span><div>Imagine something like this:</div><div><br></div><div>struct BaseStruct { ... }</div><div>class ExtendsStruct: BaseStruct { ... }</div><div><br></div><div>func foo(x: BaseStruct) { ... }</div><div>func bar(x: inout BaseStruct) { ... }</div><div><br></div><div>var x = ExtendsStruct(...)</div><div>foo(x)</div><div>bar(&amp;x)</div></div></div></blockquote><div><br></div><div>would be:</div><div><br></div><div>foo(x) // same as foo(x.super)  for which it easy to see what&#39;s going on</div><div>bar(&amp;x) // same as bar(&amp;x.super) for which it is easy to see what&#39;s going on</div><div> <br></div><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"><div dir="ltr"><div class="gmail_quote"><div>What is the behavior in each of these cases? Do foo and bar get a value-type slice of x? Is that slice the same memory as is occupied by x, or is it a copy? When bar mutates its argument, does it modify the same memory occupied by x?</div></div></div></blockquote><div><br></div><div>all these questions are easily answered if you consider the equivalent manual implementation...</div><div> </div><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"><div dir="ltr"><div class="gmail_quote"><div>Let&#39;s go back to step 1: what&#39;s your use case for wanting inheritance between a class and a struct vs. something like protocol forwarding?</div></div></div></blockquote><div><br></div><div>i don&#39;t control the preexisting value type in general case, so there is no protocol around to hijack.</div><div><br></div><div>essentially this proposal allows your own or preexisting value type to act as a reference type without having any code or upfront provisions. no more, no less. if you ever had a thought similar to: &quot;i need String / Data / Rect / etc but the one that&#39;s reference type&quot; this device will be for you.</div><div><br></div><div>class ClassString: String {}</div><div>class ClassData: Data {}</div><div>class ClassCGRect: CGRect {}</div><div><br></div><div>Mike<br></div><div><br></div></div></div></div>