diff --git a/std/typecons.d b/std/typecons.d index b1222fc50..173b8115a 100644 --- a/std/typecons.d +++ b/std/typecons.d @@ -4234,6 +4234,11 @@ struct Typedef(T, T init, string cookie=null) Typedef_payload = init; } + this(Typedef tdef) + { + this(tdef.Typedef_payload); + } + mixin Proxy!Typedef_payload; } @@ -4317,6 +4322,14 @@ unittest } } +unittest // Issue 12596 +{ + import std.typecons; + alias TD = Typedef!int; + TD x = TD(1); + TD y = TD(x); + assert(x == y); +} /** Allocates a $(D class) object right inside the current scope,