[Issue 14632] Diagnostic improvement for invalid cast with alias this

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 9 11:35:02 UTC 2018


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

Nick Treleaven <nick at geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick at geany.org

--- Comment #1 from Nick Treleaven <nick at geany.org> ---
Reduced:

struct Tuple(T...)
{
    alias Types = T;
    Types expand;
    alias expand this;
}

void test()
{
    Tuple!(int, int) point;
    auto newPoint = cast(Object)(point);
}

Error messages no longer use '__tup$n$' but could still be improved as per
comment 0:

onlineapp.d(10): Error: cannot cast expression point.__expand_field_0 of type
int to object.Object
onlineapp.d(10): Error: cannot cast expression point.__expand_field_1 of type
int to object.Object

--


More information about the Digitalmars-d-bugs mailing list