[Issue 6036] New: Constructor, static opCall and object opCall
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu May 19 01:01:25 PDT 2011
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: nobody at puremagic.com
ReportedBy: k.hara.pg at gmail.com
--- Comment #0 from Kenji Hara <k.hara.pg at 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: -------
More information about the Digitalmars-d-bugs
mailing list