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

           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
        AssignedTo: nob...@puremagic.com
        ReportedBy: k.hara...@gmail.com


--- Comment #0 from Kenji Hara <k.hara...@gmail.com> 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)
opCalls.
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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to