digitalmars.D.bugs - [Issue 11482] New: Add `alias this` support for `null` class instances
- d-bugmail puremagic.com (35/35) Nov 09 2013 https://d.puremagic.com/issues/show_bug.cgi?id=11482
https://d.puremagic.com/issues/show_bug.cgi?id=11482 Summary: Add `alias this` support for `null` class instances Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: verylonglogin.reg gmail.com 16:55:04 MSK --- As `alias this` may be used to inheritance support a conversion from base to derived is expected to work also for `null` class instances. A possible solution as to allow aliasing static or non-member function which accepts the type as a parameter: --- class A { } A asA(B b) { return b ? b.a : null; } class B { A a; alias asA this; } void main() { B b = null; A a = b; // rewritten as `asA(b)` } --- Based on Issue 2929. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 09 2013