www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21804] New: Type list (tuple) not expanded in delegate during

https://issues.dlang.org/show_bug.cgi?id=21804

          Issue ID: 21804
           Summary: Type list (tuple) not expanded in delegate during IFTI
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dlang-bugzilla thecybershadow.net

//////////////////// 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.

--
Apr 06 2021