Extracting a function symbol from overloads by __traits(getOverloads), and combining them by alias declaration should generate new overloads. See following code. ---- template TypeTuple(T...){ alias T TypeTuple; } template Id( T){ alias T Id; } template Id(alias A){ alias A Id; } struct S { static void foo(){} static void foo(int){} } struct T { alias TypeTuple!(__traits(getOverloads, S, "foo")) FooInS; alias FooInS[0] foo; // should be S.foo() static void foo(string){} } struct U { alias TypeTuple!(__traits(getOverloads, S, "foo")) FooInS; alias FooInS[1] foo; // should be S.foo(int) static void foo(string){} } void main() { alias TypeTuple!(__traits(getOverloads, S, "foo")) FooInS; static assert(FooInS.length == 2); FooInS[0](); static assert(!__traits(compiles, FooInS[0](0))); static assert(!__traits(compiles, FooInS[1]())); FooInS[1](0); Id!(FooInS[0])(); static assert(!__traits(compiles, Id!(FooInS[0])(0))); static assert(!__traits(compiles, Id!(FooInS[1])())); Id!(FooInS[1])(0); alias TypeTuple!(__traits(getOverloads, T, "foo")) FooInT; static assert(FooInT.length == 2); // fail FooInT[0](); static assert(!__traits(compiles, FooInT[0](0))); static assert(!__traits(compiles, FooInT[0](""))); static assert(!__traits(compiles, FooInT[1]())); static assert(!__traits(compiles, FooInT[1](0))); // fail FooInT[1](""); // fail alias TypeTuple!(__traits(getOverloads, U, "foo")) FooInU; static assert(FooInU.length == 2); static assert(!__traits(compiles, FooInU[0]())); FooInU[0](0); static assert(!__traits(compiles, FooInU[0](""))); static assert(!__traits(compiles, FooInU[1]())); static assert(!__traits(compiles, FooInU[1](0))); FooInU[1](""); } ----
https://github.com/D-Programming-Language/dmd/pull/748
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/2d23bfa74395340adf720c406678604b9704915d Merge pull request #748 from 9rnsr/fix7552 Issue 7552 - Cannot get and combine a part of overloaded functions