https://issues.dlang.org/show_bug.cgi?id=14093

Igor Stepanov <wazar.leoll...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |wazar.leoll...@yahoo.com
         Resolution|FIXED                       |---

--- Comment #6 from Igor Stepanov <wazar.leoll...@yahoo.com> ---
This issue is not fully solved.
There is simpler example:
-----------------------------------------
struct FooBar
{
    int a;
    int b;
}

void test14093()
{
    FooBar foo;
    auto obj = cast(Object)foo; //e2ir: cannot cast foo of type FooBar to type
object.Object
}
-----------------------------------------
Moreover, I think, this issue is solved incorrectly: alias this mechanism
should reject `cast(Object)(point._tupleAliasThis_)` variant and continue
process the root casting "cast(Object)point" excluding alias this.
And result error message should be 
"Error: cannot cast expression point of type Tuple!(int, "x", int, "y") to
object.Object".
We are interested in subtyping (alias this, or inheritance) only when it can
done its work (casting, .member ...).

--

Reply via email to