June 28, 2018 [Issue 19032] Alias this does not interact with inheritance. | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19032 Simen Kjaeraas <simen.kjaras@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |simen.kjaras@gmail.com --- Comment #1 from Simen Kjaeraas <simen.kjaras@gmail.com> --- Simplified: class A { int n; alias n this; } class B : A {} unittest { // Works when accessed through an A: static assert(__traits(compiles, cast(int)new A())); static assert(__traits(compiles, cast(int)cast(A)new B())); // Fails when accessed through a B: static assert(!__traits(compiles, cast(int)new B())); } OP also requires multiple alias this, which the documentation states is currently unimplemented (issue 6083). -- |
June 28, 2018 [Issue 19032] Alias this does not interact with inheritance. | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19032 Simen Kjaeraas <simen.kjaras@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #2 from Simen Kjaeraas <simen.kjaras@gmail.com> --- *** This issue has been marked as a duplicate of issue 5380 *** -- |
Copyright © 1999-2021 by the D Language Foundation