Bug 21804 – Type list (tuple) not expanded in delegate during IFTI

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-04-06T07:24:01Z
Last change time
2024-12-13T19:15:47Z
Assigned to
No Owner
Creator
Vladimir Panteleev
Moved to GitHub: dmd#19905 →

Comments

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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19905 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB