[Issue 18833] [REG 2.073] DMD in some cases forgets to generate wrapping TypeInfo for modifiers on classes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 25 11:08:46 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18833

--- Comment #4 from Steven Schveighoffer <schveiguy at yahoo.com> ---
Mike,

We worked through all that at dconf (including putting your recommended print
statements, etc). What is happening is that the call to see if dmd should
generate the TypeInfo *is* made, but the compiler decides it doesn't have to
because it believes the TypeInfo has already been generated in the imported
module.

The real problem here is that the compiler treats the class typeinfo that has
the const flag set identically to how it treats the class typeinfo that doesn't
have the const flag set. In other words, it elides generating the
Const_TypeInfo wrapper because it has already generated the TypeInfo_Class.

It's really difficult to explain, but look at the function in dsymbolsem.d that
sets the instantiated module to null.

Then look at typinf.d for isSpeculativeType.

The decision not to generate the Const_TypeInfo is confused with the decision
not to instantiate the class that it wraps. I don't know how to extract them
into 2 separate decisions, which is why I'm not the one to solve this. Still
getting my feet wet with DMD development.

--


More information about the Digitalmars-d-bugs mailing list