Summary: DMD tries to call static Foo.opCall() on
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P2
         Component: DMD

--- Comment #0 from klickverbot <> 2011-05-28 13:28:17 PDT 
struct Foo {
  static Foo opCall() {
    return Foo.init;

void main() {
  auto foo = cast(immutable(Foo)) Foo.init;

// test.d(8): Error: function test.Foo.opCall () is not callable using argument
types (Foo)
// test.d(8): Error: expected 0 arguments, not 1 for non-variadic function type


I don't know how DMD could possibly try to call a function inside the cast()
type parameter, but it seems like it does. const() instead of immutable()
produces the error as well, just cast(Foo) works.

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

Reply via email to