Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
re-enable 'one call to method opEquals' in CTFE
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Boßung committed Feb 5, 2015
1 parent 42de517 commit 8d61469
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/object.di
Expand Up @@ -64,8 +64,11 @@ bool opEquals(Object lhs, Object rhs)
if (lhs is null || rhs is null) return false;

// If same exact type => one call to method opEquals
if (!__ctfe && // CTFE doesn't like comparing typeid
(typeid(lhs) is typeid(rhs) || typeid(lhs).opEquals(typeid(rhs))))
if (typeid(lhs) is typeid(rhs) ||
!__ctfe && typeid(lhs).opEquals(typeid(rhs)))
/* CTFE doesn't like typeid much. 'is' works, but opEquals doesn't
(issue 7147). But CTFE also guarantees that equal TypeInfos are
always identical. So, no opEquals needed during CTFE. */
{
return lhs.opEquals(rhs);
}
Expand Down
7 changes: 5 additions & 2 deletions src/object_.d
Expand Up @@ -169,8 +169,11 @@ bool opEquals(Object lhs, Object rhs)
if (lhs is null || rhs is null) return false;

// If same exact type => one call to method opEquals
if (!__ctfe && // CTFE doesn't like comparing typeid
(typeid(lhs) is typeid(rhs) || typeid(lhs).opEquals(typeid(rhs))))
if (typeid(lhs) is typeid(rhs) ||
!__ctfe && typeid(lhs).opEquals(typeid(rhs)))
/* CTFE doesn't like typeid much. 'is' works, but opEquals doesn't
(issue 7147). But CTFE also guarantees that equal TypeInfos are
always identical. So, no opEquals needed during CTFE. */
{
return lhs.opEquals(rhs);
}
Expand Down

0 comments on commit 8d61469

Please sign in to comment.