Skip to content

Commit

Permalink
Merge pull request #3813 from WalterBright/revert3731
Browse files Browse the repository at this point in the history
[reg] fix Issue 13179 - AA key type TagIndex now requires equality rather than...
  • Loading branch information
9rnsr committed Jul 27, 2014
2 parents c876355 + 97045ea commit 6363a7f
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; }
}

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

This file was deleted.

0 comments on commit 6363a7f

Please sign in to comment.