Comment #0 by dlang-bugzilla — 2021-04-06T07:24:01Z
//////////////////// test.d ////////////////////
alias AliasSeq(TList...) = TList;
void main()
{
struct S { void m() {} }
alias Args = AliasSeq!(S);
void fun(R)(R delegate(Args) dg)
{
}
fun!void((result) { result.m(); }); // OK
fun ((result) { result.m(); }); // error
}
////////////////////////////////////////////////
In the second case, `result` is a tuple containing an `S`, which doesn't seem right.
Comment #1 by dlang-bugzilla — 2021-04-06T07:36:40Z
Found a really weird workaround:
fun ((result) { }); // OK
fun ((result) { result.m(); }); // OK ?????
Looks like we can trick the compiler into doing the right thing by first making a dummy instantiation which does not access `result`.
Comment #2 by nick — 2024-07-13T12:01:29Z
Using:
fun ((result) { pragma(msg, typeof(result)); });
The pragma fires twice:
(S)
S
Comment #3 by robert.schadek — 2024-12-13T19:15:47Z