Silence warning: struct Rebindable has method toHash, however it cannot be called with const(Rebindable!(const(C))) this.

This commit is contained in:
Iain Buclaw 2019-10-07 23:29:47 +02:00
parent 6a1a06cd36
commit bb7bd70fbf
2 changed files with 2 additions and 2 deletions

View file

@ -1790,7 +1790,7 @@ if (isInputRange!R)
assert(equal(g3, [ tuple(1, 2u), tuple(2, 2u) ])); assert(equal(g3, [ tuple(1, 2u), tuple(2, 2u) ]));
interface I {} interface I {}
class C : I {} class C : I { override size_t toHash() const nothrow @safe { return 0; } }
const C[] a4 = [new const C()]; const C[] a4 = [new const C()];
auto g4 = a4.group!"a is b"; auto g4 = a4.group!"a is b";
assert(g4.front[1] == 1); assert(g4.front[1] == 1);

View file

@ -1979,7 +1979,7 @@ private template ReverseTupleSpecs(T...)
@safe unittest @safe unittest
{ {
class C {} class C { override size_t toHash() const nothrow @safe { return 0; } }
Tuple!(Rebindable!(const C)) a; Tuple!(Rebindable!(const C)) a;
Tuple!(const C) b; Tuple!(const C) b;
a = b; a = b;