Summary: Constructor, static opCall and object opCall
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid, rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Kenji Hara <> 2011-05-19 00:57:14 PDT ---
Created an attachment (id=980)
Test cases for this issue.

struct S{ ... }
S(...)  // (a)
S s;
s(...)  // (b)
We should lookup them following order:

(a) From type
1. Constructor call
   Constructors are defined with arguments (>= 1), and hide any signature of
static opCalls.
2. Static opCall
   If no constructors exists, static opCalls are checked.
3. When matching with 1 and 2 failed, struct literal syntax is checked.
4. Otherwise makes error.

(b) From object
1. Matchings are tested against static opCalls and object (=non-static)
2. No opCalls makes error.

These rules reject following current dmd bugs:
- Constructors are visible from object.
  This problem pointed out by issue 1840, issue 4053 and issue 4253.
- Object opCalls are visible from type.

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

Reply via email to