TypeInfo madness

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Tue Mar 8 13:38:58 PST 2016


On 3/7/16 1:33 PM, Yuxuan Shui wrote:
> On Monday, 7 March 2016 at 08:49:36 UTC, Johan Engelen wrote:
>> On Monday, 7 March 2016 at 01:47:53 UTC, Yuxuan Shui wrote:
>>> On Sunday, 6 March 2016 at 23:27:45 UTC, Adam D. Ruppe wrote:
>>>> It is just a mistake that TypeInfo isn't immutable, in my opinion.
>>>>
>>>> ...though changing it would be a breaking change, I think it would
>>>> make sense to do it.
>>>
>>> Is there really anything relies on TypeInfo being mutable?
>>
>> LDC produces a crashing program when you change TypeInfo.name:
>> https://github.com/ldc-developers/ldc/issues/1337
>
> This is because LDC put the TypeInfo struct in .rodata! Which is great.
> Further prove the point that no one is modifying TypeInfo.

Great evidence. Guess we should make everything immutable then. -- Andrei


More information about the Digitalmars-d mailing list