<div dir="ltr">sorry if this was already discussed.<br><div><div><br></div><div>proposing an ability to derive a class from a struct or another value type (e.g. enum).</div><div>would make it easy to wrap value type in a reference type without explicit code:</div><div><br></div><div>struct S {</div><div>    var v: Int</div><div>    func method() {}</div><div>    static staticMethod() {}</div><div>}</div><div><br></div><div>class C: S {</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>func otherMethod() {}</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>// ...</div><div>}</div><div><br></div><div>let c = C()</div><div><br></div><div>c.v = 1</div><div>c.method()</div><div>C.staticMethod()</div><div>c.otherMethod()</div><div><br></div><div>shall work as if i had a struct variable and all struct functions implemented in a class calling through that var:</div><div><br></div><div>pseudo code:</div><div><br></div><div>class C {</div><div><br></div><div>// auto generated internally:</div><div>    var `struct`: S</div><div>    </div><div>    func method() {</div><div>        `struct`.method()</div><div>    }</div><div>    static staticMethod() {</div><div>        S.staticMethod()</div><div>    }</div><div>//---</div><div>    </div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>func otherMethod() {}</div><div>}</div><div><br></div><div>would also be nice to have ability to overload struct&#39;s methods:</div><div><br></div><div>class C: S {</div><div>    override func method() {</div><div>        super.method()<br></div><div>    }<br></div><div>}</div><div><br></div><div>and have struct initializators inherited:</div><div><br></div><div>let c = C(struct initialization params)</div><div><br></div><div>thoughts?</div><div><br></div><div>Mike</div></div><div><br></div></div>