www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Annoying toHash warnings

I have updated my compiler yesterday, and now I get:

Warning: struct Value has method toHash, however it cannot be called 
with const(Value) this.
Warning: struct Closure has method toHash, however it cannot be called 
with const(Closure) this.
Warning: struct ℚ has method toHash, however it cannot be called with 
const(ℚ) this.

This is new, completely spurious, does not even spit out line numbers, 
and it does not seem to appear in the change log.

My toHash functions actually don't change any memory pointed to by the 
receiver, but I don't want to annotate them const, and actually I can't 
even do so while using the default toHash implementation for class 
objects. So not only is the compiler needlessly asking me to jump 
through some hoops, the hoops are not even there and would need to be 
first constructed manually.

Why was this added? It's very annoying.
May 31