Probably related to issue 14603.
----
struct S
{
template opDispatch(string name)
{
void opDispatch()() {}
}
}
alias a = S.opDispatch!"go"; /* ok */
version(none) alias b = S.go; /* "cannot alias an expression" - issue 14603 */
alias Identity(alias thing) = thing;
alias c = Identity!(S.opDispatch!"go"); /* ok */
alias d = Identity!(S.go); /* 'Error: template instance opDispatch!"go" cannot resolve forward reference' */
----
`S.go` should be equivalent to `S.opDispatch!"go"`.
Workaround:
----
struct S
{
template opDispatch(string name)
{
auto impl(Args ...)(Args args) {}
alias opDispatch = impl;
}
}
----