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

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #11 from [email protected] ---
I think this enhancement request should be closed now that
https://github.com/D-Programming-Language/phobos/pull/2116 has been merged.
With that PR, your first example now becomes:

void main() {
    import std.typecons: Typedef;
    import std.math: sin;
    alias Angle = Typedef!double;
    Angle x = 0.5;
    auto y1 = sin(x); // Error.
    auto y2 = sin(cast(TypedefType!Angle)x); // OK.
}

A bit verbose, but it accomplishes what you want and is more DRY and safer than
cast(double)x.

--

Reply via email to