Can getHash be made pure?

Martin Nowak dawg at dawgfoto.de
Fri Mar 9 19:21:05 PST 2012


On Sat, 10 Mar 2012 03:18:59 +0100, Walter Bright  
<newshound2 at digitalmars.com> wrote:

> On 3/9/2012 5:15 PM, H. S. Teoh wrote:
>> I tried to make getHash() const pure nothrow @safe, but found that in
>> some places it calls toHash() which isn't marked const pure nothrow
>> @safe.  So I fixed that as well, then found that toHash() calls
>> toString() which isn't pure, nothrow, nor @safe... and before I knew it,
>> I was deep into marking a *lot* of druntime functions (as perhaps they
>> *should* be), and then I ran into this:
>>
>> src/object_.d(648): Error: function  
>> object.TypeInfo_AssociativeArray.next () is not callable using argument  
>> types ()
>> src/object_.d(648): Error: function  
>> object.TypeInfo_AssociativeArray.next () is not callable using argument  
>> types ()
>> src/object_.d(759): Error: function object.TypeInfo_Class.info () is  
>> not callable using argument types ()
>> src/object_.d(1334): Error: cannot uniquely infer foreach argument types
>> src/core/runtime.d(483): Error: cannot uniquely infer foreach argument  
>> types
>> make: *** [lib/libdruntime-linux32.a] Error 1
>
> Yeah, I know, it's viral. Can't do it piecemeal.
>
Bottom-up instead of top-down?


More information about the Digitalmars-d mailing list