[Issue 12884] implicit conversion wrongly prefers casting immutable away over alias this when target type is base class
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Jun 15 19:32:57 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12884
Kenji Hara <k.hara.pg at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |INVALID
--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> ---
With class types, the possibility of implicit class reference conversion from
derived D to base class B is always determined in type system.
In other words, conversion from immutable D to mutable B is a defined but
disabled by default, and 'alias this' cannot override it.
(Note that 'alias this' is invoked when the conversion is _not_ defined)
So, 'alias this' never be considered in the case, and this is invalid issue.
--
More information about the Digitalmars-d-bugs
mailing list