Summary: opCall() not called in initialized struct
           Product: D
           Version: future
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-05-30 09:27:07 PDT ---
This is a small C++ program that compiles:

template<typename T> struct Foo {
    Foo(T x) {}
    template<typename U> void operator()(U y) {}
int main() {
    Foo<int> foo(1);

I think this is an equivalent D2 program:

struct Foo(T) {
    this(T x) {}
    void opCall(U)(U y) {}
void main() {
    auto foo = Foo!int(1);
    foo(1.5); // line 7

But DMD V. 2.046 prints:
temp.d(7): Error: constructor temp.Foo!(int).Foo.this (int x) is not callable
using argument types (double)
temp.d(7): Error: cannot implicitly convert expression (1.5) of type double to

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

Reply via email to