Finding source of typeid use

Rainer Schuetze via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jul 8 01:56:17 PDT 2017



On 08.07.2017 07:55, Nicholas Wilson wrote:
> On Saturday, 8 July 2017 at 05:36:49 UTC, rikki cattermole wrote:
>> On 08/07/2017 2:35 AM, Nicholas Wilson wrote:
>>> On Friday, 7 July 2017 at 08:49:58 UTC, Nicholas Wilson wrote:
>>>> My library is generating a typeid from somewhere.
>>>> e.g.
>>>> typeid(const(Pointer!(cast(AddrSpace)1u, float)))
>>>>
>>>> [...]
>>>
>>> It seems to be coming from the need to hash the type, goodness knows 
>>> why, which explains why I only get the const variety.
>>
>> https://github.com/dlang/druntime/blob/master/src/object.d#L253 Maybe?
> 
> No, the culprit is
> https://github.com/dlang/druntime/blob/master/src/object.d#L1128
> but IDK why it is being generated in the first place since nothing I 
> wrote relies on being able to hash it.

I suspect this is generated while building the hash function for your 
Pointer struct in buildXtoHash in ddmd/clone.d.


More information about the Digitalmars-d-learn mailing list