[Issue 8570] Tuples without named fields should implicitly convert to tuples with named fields when returned from a function

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jul 2 11:32:46 PDT 2017


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

Vladimir Panteleev <dlang-bugzilla at thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dlang-bugzilla at thecybershad
                   |                            |ow.net
         Resolution|---                         |WONTFIX

--- Comment #2 from Vladimir Panteleev <dlang-bugzilla at thecybershadow.net> ---
Reduced:

struct S { this(int) {} }

void bar()
{
    S s = 5;
}

S foo()
{
    return 5;
}

The first is an initialization / assignment; the second is an implicit
conversion. Currently D does not allow defining implicit conversions to
arbitrary types (closest is alias this, but it can alias only specific types).

Providing some way for types to do implicit conversions to arbitrary other
types is a much bigger discussion outside of the scope of this issue.

--


More information about the Digitalmars-d-bugs mailing list