Skip to content

Commit

Permalink
fix Issue 13179 - AA key type TagIndex now requires equality rather t…
Browse files Browse the repository at this point in the history
…han comparison
  • Loading branch information
WalterBright committed Jul 26, 2014
1 parent 031c94f commit 97045ea
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 100 deletions.
23 changes: 0 additions & 23 deletions src/mtype.c
Expand Up @@ -4746,29 +4746,6 @@ printf("index->ito->ito = x%x\n", index->ito->ito);
// AA assumes that its result is consistent with bitwise equality.
// else:
// bitwise equality & hashing

#if 1
/* Note that this diagnostic error report should be removed in near future.
* See also bugzilla 13074.
*/

// duplicate a part of StructDeclaration::semanticTypeInfoMembers
if (sd->xcmp &&
sd->xcmp->scope &&
sd->xcmp->semanticRun < PASSsemantic3done)
{
unsigned errors = global.startGagging();
sd->xcmp->semantic3(sd->xcmp->scope);
if (global.endGagging(errors))
sd->xcmp = sd->xerrcmp;
}
if (sd->xcmp && sd->xcmp != sd->xerrcmp)
{
error(loc, "%sAA key type %s now requires equality rather than comparison",
s, sd->toChars());
errorSupplemental(loc, "Please define opEquals, or remove opCmp to also rely on default memberwise comparison.");
}
#endif
}
else if (sd->xeq == sd->xerreq)
{
Expand Down
4 changes: 2 additions & 2 deletions test/compilable/test12593.d
Expand Up @@ -4,8 +4,8 @@ struct R
{
int opCmp(ref const R) const { return 0; }

bool opEquals(ref const R) const { return true; }
size_t toHash() const nothrow @safe { return 0; }
//bool opEquals(ref const R) const { return true; }
//size_t toHash() const nothrow @safe { return 0; }

This comment has been minimized.

Copy link
@andralex

andralex Jul 28, 2014

Member

Code should be removed outright.

}

void main()
Expand Down
75 changes: 0 additions & 75 deletions test/fail_compilation/diag13074.d

This file was deleted.

0 comments on commit 97045ea

Please sign in to comment.