Skip to content

Removing __monitor from Object leads to errors #22813

@TurkeyMan

Description

@TurkeyMan

I removed the __monitor field from Object, but...

Error: `TypeInfo_Struct`: mismatch between compiler (136 bytes) and object.d or object.di (128 bytes) found
class TypeInfo_Struct : TypeInfo
^

So... apparently the compiler has some sort of internal affinity for the typeinfo of the thing being compiled? I'd rather like to think the compiler shouldn't be coupled to the output in that way.

But there's a further problem; if I add __monitor back to my Object to try and suppress this error, DMD (master) stops complaining, but LDC does complain, because it's still internal to that compiler.

Can anyone think if a clever compile time condition I can use to determine if I should include __monitor in Object or not? I need some kind of way to determine if the frontend expects it to be declared in object.d or if it's still internally defined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions