[Issue 3367] Regression: struct initialization no longer supports ctor overloads

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3367

Andrei Alexandrescu  changed:

   What|Removed |Added

Version|2.033   |D2

--


[Issue 3367] Regression: struct initialization no longer supports ctor overloads

2009-11-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3367


Leandro Lucarella  changed:

   What|Removed |Added

 CC||llu...@gmail.com


--- Comment #3 from Leandro Lucarella  2009-11-04 06:39:53 
PST ---
SVN commit: http://www.dsource.org/projects/dmd/changeset/235

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


[Issue 3367] Regression: struct initialization no longer supports ctor overloads

2009-10-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3367


Don  changed:

   What|Removed |Added

   Keywords||patch


--- Comment #2 from Don  2009-10-29 12:58:44 PDT ---
PATCH: declaration.c, line 1094.
{
/* Look for opCall
 * See bugzilla 2702 for more discussion
 */
Type *ti = ei->exp->type->toBasetype();
--- ADD THIS CODE:
// Look for ctor
if (sd->ctor && 
/* Initializing with the same type is done differently
 */
!(ti->ty == Tstruct && t->toDsymbol(sc) == ti->toDsymbol(sc)))
{
   // Rewrite as e1.call(arguments)
Expression * eCall = new DotIdExp(loc, e1, Id::ctor);
ei->exp = new CallExp(loc, eCall, ei->exp);
} 
else
---
// Don't cast away invariant or mutability in initializer
if (search_function(sd, Id::call) &&

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


[Issue 3367] Regression: struct initialization no longer supports ctor overloads

2009-10-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3367


Sobirari Muhomori  changed:

   What|Removed |Added

   Severity|normal  |regression


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


[Issue 3367] Regression: struct initialization no longer supports ctor overloads

2009-10-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3367


Don  changed:

   What|Removed |Added

 CC||clugd...@yahoo.com.au
Summary|Regression: assignment at   |Regression: struct
   |declaration no longer   |initialization no longer
   |supports opAssign or ctor   |supports ctor overloads
   |overloads   |


--- Comment #1 from Don  2009-10-06 01:14:23 PDT ---
My fault. This is a consquence of the fix to bug 2702. Previously it used to
accept any old garbage inside a struct initializer; now it only accepts static
opCall. It should definitely allow constructors as well. 

Based on my reading of the spec, the fact that opAssign used to work seems to
have been a bug:
"assignment is defined as copying the contents of one object over another,
already initialized, type" (struct.html)

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