[Issue 3983] Regression(2.037): struct with == can't be member of struct with template opEquals

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

Andrei Alexandrescu  changed:

   What|Removed |Added

Version|2.034   |D2

--


[Issue 3983] Regression(2.037): struct with == can't be member of struct with template opEquals

2010-06-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3983


Walter Bright  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


--- Comment #2 from Walter Bright  2010-06-27 
23:15:27 PDT ---
http://www.dsource.org/projects/dmd/changeset/564

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


[Issue 3983] Regression(2.037): struct with == can't be member of struct with template opEquals

2010-06-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3983


Don  changed:

   What|Removed |Added

   Keywords||patch


--- Comment #1 from Don  2010-06-11 02:36:12 PDT ---
Problem is in struct.c, StructDeclaration::semantic(), line 497:
it tries to find an opEquals() function, and if not present, it builds one.
It should look for a template opEquals() also. If there's a template opEquals,
then creating a non-template opEquals will inevitably cause a naming conflict.


Dsymbol *s = search_function(this, Id::eq);
FuncDeclaration *fdx = s ? s->isFuncDeclaration() : NULL;
+TemplateDeclaration *td = s ? s->isTemplateDeclaration() : NULL;
if (fdx)
{
eq = fdx->overloadExactMatch(tfeqptr);
if (!eq)
fdx->error("type signature should be %s not %s",
tfeqptr->toChars(), fdx->type->toChars());
}

-if (!eq)
+if (!eq && !td)
eq = buildOpEquals(sc2);

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