www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22433] New: ITFI fails with alias declared inside template,


          Issue ID: 22433
           Summary: ITFI fails with alias declared inside template, used
                    in function signature
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: iamthewilsonator hotmail.com

template foo(I)
    alias Idx = int;
    void foo(I,Idx,int) {}

struct A {}
void main()
    A a;
    //    Error: undefined identifier `Idx`"
    //    Error: template `onlineapp.write` cannot deduce function from
argument types `!()(A, int, int)`, candidates are:
    //        `foo(I)(I, Idx, int)`
    a.foo(0,0); // 1

    a.foo!A(0,0); // 2

reordering the statements 1 and 2 still results in failure.

Oct 23 2021