Bug 2052 – Static initialization of every kind of variable in aggregates, including classes

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2008-04-28T04:09:28Z
Last change time
2024-12-13T17:48:28Z
Assigned to
No Owner
Creator
Marcin Kuszczak
Moved to GitHub: dmd#17710 →

Comments

Comment #0 by aarti — 2008-04-28T04:09:28Z
Current behavior leads to very unclean code. You have to write: 1a. class A {} class B { static A a; this() { a = new A; } } or static this() { B.a = new A; } instead of just: 1b. class B { static A a = new A; } in every case. Request is for classes, structs and global variables.
Comment #1 by robert.schadek — 2024-12-13T17:48:28Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17710 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB