Bug 1348 – offTi property of TypeInfo return empty array.
Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-07-18T18:10:45Z
Last change time
2019-08-20T12:44:00Z
Keywords
spec
Assigned to
No Owner
Creator
Aaron Craelius
Comments
Comment #0 by aaroncraelius — 2007-07-18T18:10:45Z
The OffsetTypeInfo array returned by the offTi property of TypeInfo seems to be empty for classes that I have tried to examine. I have tested this with Tango and DMD 1.018 and 1.015 and with Phobos and DMD 2.002.
Comment #1 by gamerChad — 2007-08-14T09:46:12Z
I am testing with dmd+phobos on Windows.
I found that this bug is present on dmd 1.004, 1.010, and 1.020.
I also found that the offTi property does not seem to exist in dmd 1.003. The OffsetTypeInfo type is also not present in that version.
Comment #2 by matti.niemenmaa+dbugzilla — 2007-08-31T06:34:56Z
This appears to never have been implemented:
From toobj.c in the DMD 2.040 source tree, at both 462-464 and 909-911:
// offTi[]
dtdword(&dt, 0);
dtdword(&dt, 0); // null for now, fix later
I ran into this in attempting to do runtime reflection for serialization, etc. without forcing the use if template mixins, etc.
Comment #4 by sandford — 2010-12-27T09:27:09Z
Gide, wrong-code bugs are bugs where the assembly generated by DMD is incorrect. Not generating the offset type info isn't a wrong-code bug. Generating a bad offset typeinfo array would be.
Comment #5 by gide — 2010-12-27T10:56:02Z
I thought anything the compiles and does not work as defined by the spec is wrong-code, this would include outputting zeros instead of an offset.
Comment #6 by nfxjfg — 2010-12-27T13:08:04Z
(In reply to comment #3)
> I ran into this in attempting to do runtime reflection for serialization, etc.
> without forcing the use if template mixins, etc.
You better start using a real programming language then, such as Scala, Vala or Go.
Walter most likely disabled generation of this because it took too much space. The direction D2 is going is towards compile time reflection, and cutting down runtime reflection. (Even though compile time reflection will lead to much worse code bloat in the end, but the D designers don't know how to make sense.)
This bug should probably be closed as INVALID, but leaving it open is a good way to put a little stress in Walter & Co.
Comment #7 by sandford — 2010-12-27T13:46:23Z
nfxjfg, as noted in this bug report, this isn't a regression: D has never had any form of runtime-reflection so Walter can't have disabled it, etc. To the best of my knowledge, the shape of D's runtime reflection is still pending.
Gide, you're technically right, but I feel there's a big difference in severity between, not implemented yet and silently generating incorrect code. I have added the spec keyword, because it's probably a good idea to remove the Offset type info placeholders until D's runtime-reflection strategy is defined.
Comment #8 by bugzilla — 2012-01-21T19:53:10Z
It's not implemented yet, but is there as a placeholder. The shape of how introspection is best done is as yet undetermined. Hence I'll mark it as an enhancement request.
Comment #9 by razvan.nitu1305 — 2019-08-20T12:44:00Z
Introspection is now done at compile time. Closing this as invalid.