[Issue 6036] Constructor, static opCall and object opCall

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 14 07:41:33 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=6036


jens.k.mueller at gmx.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jens.k.mueller at gmx.de


--- Comment #9 from jens.k.mueller at gmx.de 2012-08-14 07:41:29 PDT ---
This bug makes using opCall practically useless.
As soon as you have a constructor you get a compile error when you want to call
opCall using the bracket syntax.
E.g. the following code does not compile.

struct F {
  this(int a) { }
  int opCall(int x, int y)
  {
      return 1;
  }
}

unittest
{
  F f;
  int i;

  i = f(3,4,5);
  // Error: constructor F.this (int a) is not callable using argument
  // types (int,int,int)
  // workaround: i = f.opCall(3,4,5);
}

This is v2.060 on Linux.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list