[Issue 12596] New: Typedef(Typedef) => Typedef

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Apr 19 02:11:00 PDT 2014


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

          Issue ID: 12596
           Summary: Typedef(Typedef) => Typedef
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody at puremagic.com
          Reporter: bearophile_hugs at eml.cc

void main() {
    import std.typecons;
    alias TD = Typedef!double;
    TD x = TD(1.0);
    TD y = TD(x); // Error
}


DMD 2.066alpha gives:

test.d(5,16): Error: constructor std.typecons.Typedef!(double,
nan).Typedef.this (double init) is not callable using argument types
(Typedef!(double, nan))


But I think "TD(x)" should be accepted, just like:

void main() {
    auto x = double(1);
    auto y = double(x);
}

--


More information about the Digitalmars-d-bugs mailing list