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

          Issue ID: 17809
           Summary: "this" is implicitly captured by template with alias
                    parameter
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: john.loughran.col...@gmail.com

template A()
{
    auto A() { return this; }
}

template B(alias a)
{
    auto B() { return this; }
}

struct S
{
    int a;

    // Error: 'this' is only defined in non-static member functions, not A
    alias foo0 = A!();

    // OK ??? I don't think this should work
    alias foo1 = B!(a);
}

--

Reply via email to