From bb7bd70fbf1b47a3b25d8dcdec0ff742ced33bfb Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Mon, 7 Oct 2019 23:29:47 +0200 Subject: [PATCH] Silence warning: struct Rebindable has method toHash, however it cannot be called with const(Rebindable!(const(C))) this. --- std/algorithm/iteration.d | 2 +- std/typecons.d | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/std/algorithm/iteration.d b/std/algorithm/iteration.d index b5eb3b491..22cf27407 100644 --- a/std/algorithm/iteration.d +++ b/std/algorithm/iteration.d @@ -1790,7 +1790,7 @@ if (isInputRange!R) assert(equal(g3, [ tuple(1, 2u), tuple(2, 2u) ])); interface I {} - class C : I {} + class C : I { override size_t toHash() const nothrow @safe { return 0; } } const C[] a4 = [new const C()]; auto g4 = a4.group!"a is b"; assert(g4.front[1] == 1); diff --git a/std/typecons.d b/std/typecons.d index b05de001d..5ee188f3e 100644 --- a/std/typecons.d +++ b/std/typecons.d @@ -1979,7 +1979,7 @@ private template ReverseTupleSpecs(T...) @safe unittest { - class C {} + class C { override size_t toHash() const nothrow @safe { return 0; } } Tuple!(Rebindable!(const C)) a; Tuple!(const C) b; a = b;