Kenji Hara <> changed:

           What    |Removed                     |Added
           Keywords|                            |rejects-valid
            Summary|Cannot deduce template      |Cannot deduce template
                   |function when using UFCS    |function when inferring
                   |and having a delegate(T) as |labmda parameters over
                   |first argument and an empty |partially specialized IFTI
                   |function.                   |call.

--- Comment #1 from Kenji Hara <> 2012-06-02 21:13:50 PDT ---
This is not UFCS issue. Proper function call shows same errors.
In my opinion, the cause of problem is the inference of lambda parameters over
partially specialized IFTI call.

class X {}
class A {}
class B : A {}

void foo(T : A)(X x) {}
void foo(T : A)(X x, void function (T) block) {}

void main()
    auto x = new X;
    //!B((a){}); // UFCS version shows same errors
    foo!B(x, (a){});
    // Error: template does not match any function template
    // Error: template cannot deduce template function from argument
types !(B)(X,void)
    // Error: template instance foo!(B) errors instantiating template

    // Call explicitly aliased symbol still not good.
    alias foo!B Lol;
    Lol(x, (a){});
    // Error: template matches more than one template declaration,
test.d(5):foo(T : A) and test.d(6):foo(T : A)
    // Error: function expected before (), not foo!(B) of type void

    // But, avoiding lambda parameter inference stops errors.
    foo!B(x, (B b){});

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to