June 27, 2018 [Issue 19032] New: Alias this does not interact with inheritance. | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19032 Issue ID: 19032 Summary: Alias this does not interact with inheritance. Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: wazar.leollone@yahoo.com This case doesn't properly work. interface IShort { @property ref short getShort(); alias getShort this; } interface IString { @property ref string getString(); alias getString this; } interface IDouble { @property ref double getDouble(); alias getDouble this; } class Test : IShort, IString, IDouble { short a; string b; double d; this(short a, string b, double d) { this.a = a; this.b = b; this.d = d; } override @property ref short getShort() { return a; } override @property ref string getString() { return b; } override @property ref double getDouble() { return d; } } void test9() { Test t = new Test(1, "2", 3.0); short a = t; string b = t; double d = t; assert(a == 1); assert(b == "2"); assert(c == 3.0); } -- |
Copyright © 1999-2021 by the D Language Foundation