Bug 2836 – Navigate from ClassInfo to TypeInfo

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2009-04-15T00:16:00Z
Last change time
2015-06-09T01:18:23Z
Assigned to
bugzilla
Creator
benoit

Comments

Comment #0 by benoit — 2009-04-15T00:16:14Z
To retrieve an instance of TypeInfo from an object instance at runtime. Object obj = getSomething(); // returns a derived instance TypeInfo info = typeid(obj) // does not work, only compile time TypeInfo info = obj.classinfo.????; // how to navigate to TypeInfo? ClassInfo shall have an additional field, that make that navigation possible. A NG discussion was here: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=88011
Comment #1 by dfj1esp02 — 2009-04-15T04:17:44Z
I think, ClassInfo can just inherit from TypeInfo.
Comment #2 by tomas — 2009-04-15T04:54:41Z
Then TypeInfo_Class and TypeInfo_Interface needs to be merged as well.
Comment #3 by bugzilla — 2009-05-12T10:45:19Z
Done with dmd 1.045 and 2.030.