Bug 21016 – `Type.Field.init` is `typeof(Type.Field).init`, not the field initializer

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-07-06T03:04:58Z
Last change time
2024-12-13T19:09:54Z
Assigned to
No Owner
Creator
Mathias LANG
Moved to GitHub: dmd#19740 →

Comments

Comment #0 by pro.mathias.lang — 2020-07-06T03:04:58Z
``` struct Params { uint value = 4242; } pragma(msg, Params.value.init); ``` This should print `4242`, not `0u`. It can be worked around by using `Params.init.value` but that hoop shouldn't be necessary. Likewise the following should work: ``` template Default (alias Field) { enum Default = Field.init; } pragma(msg, Default!(Params.value)); ```
Comment #1 by robert.schadek — 2024-12-13T19:09:54Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19740 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB