[Issue 21141] New: No introspection access to a field's default value

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 10 01:23:55 UTC 2020


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

          Issue ID: 21141
           Summary: No introspection access to a field's default value
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: andrei at erdani.com

Structs and classes should offer for introspection each field's default value.
That should be available as a string that can be mixed in. For void
initialization, the string would naturally be "void".

A simpler alternative would be to just offer an array of immutable bytes that
can be used to initialize the object. That is suboptimal because it does not
skip void-initialized fields.

This blocks https://github.com/dlang/druntime/pull/3174.

--


More information about the Digitalmars-d-bugs mailing list