https://issues.dlang.org/show_bug.cgi?id=9114
--- Comment #2 from Andrej Mitrovic <[email protected]> --- Here's another workaround, where you can simply declare an alias in your code via `alias FixedForward!(target_func) fixed_func` and use it regularly. ----- import tango.core.Traits; // the magic template FixedForward ( alias func ) { struct FixedForward ( T ) { static ReturnTypeOf!(func!(T)) opCall ( X ... ) ( X x ) { return func!(T, X)(x); } } } // the target function you want to fix T[] test ( T, Args...) ( Args args ) { return cast(T[])[args]; } // just declare an alias of it alias FixedForward!(test) FixedTest; // works at ctfe const static_result = FixedTest!(short)(1, 2, 3); alias short[] ShortArray; static assert(is(typeof(static_result == ShortArray))); static assert(static_result == cast(short[])[1, 2, 3]); void main ( char[][] arg) { // works at rtfe auto result = FixedTest!(short)(1, 2, 3); static assert(is(typeof(result == ShortArray))); assert(result == cast(short[])[1, 2, 3]); } ----- --
