www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23610] New: std.typecons.Typedef doesn't forward constructors

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

          Issue ID: 23610
           Summary: std.typecons.Typedef doesn't forward constructors
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: andrej.mitrovich gmail.com

-----
import std.typecons;

struct Vec {
    this(int, int, int) {

    }
}

void main() {
    auto v1 = Vec(1, 2, 3);  // ok

    alias TVec = Typedef!Vec;
    auto v2 = TVec(1, 2, 3);  // error
}
-----

$ dmd test.d
 test.d(13): Error: none of the overloads of `this` are callable using argument
types `(int, int, int)`
--
Jan 09 2023