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