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

Vladimir Panteleev <dlang-bugzi...@thecybershadow.net> changed:

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

--- Comment #2 from Vladimir Panteleev <dlang-bugzi...@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.

--

Reply via email to