Typepinfo is always generated for structs that contain structs that have alias this
Nicholas Wilson via Digitalmars-d
digitalmars-d at puremagic.com
Sat Jul 8 20:31:12 PDT 2017
Type info is always generated for struct that contain structs
that have an alias this. This was apparently done because of
https://issues.dlang.org/show_bug.cgi?id=14948 and "fixed" in
https://github.com/dlang/dmd/pull/5001 , see also
https://github.com/dlang/dmd/blob/master/src/ddmd/clone.d#L655
with the comment bugzilla link.
I have a couple of issues with this approach:
1) it builds typeinfo even if it is not used (the above issue
involves using such a struct in an AA where it _is_ used, which
is fine).
2) it does not respect -betterC, so there is no way to not have
typeinfo which, IMO, makes -betterC rather useless.
Can we be more discerning with generation of typeinfo? i.e.
generate it lazily and only if used, perhaps with weak linkage so
end users can have it if they need it?
More information about the Digitalmars-d
mailing list