Bug 15707 – Extend aggregate TypeInfo with information about `alias this`

Status
NEW
Severity
enhancement
Priority
P4
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-02-20T12:59:52Z
Last change time
2024-12-07T13:36:24Z
Assigned to
No Owner
Creator
Dicebot
Moved to GitHub: dmd#17150 →

Comments

Comment #0 by public — 2016-02-20T12:59:52Z
Proposal: enhance TypeInfo so that for a struct like this: struct S { byte[8] x; int y; alias y this; } .. the following code will be valid: auto ti = typeid(S.init); assert (ti.aliasthis.offset == 8); assert (ti.aliasthis.next == typeid(int.init)); Use case: RTTI based formatting/logging, most importantly in cases where `alias this` struct is used as a replacement for typedef.
Comment #1 by robert.schadek — 2024-12-07T13:36:24Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17150 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB