immutable struct A { struct B { int x; } int x; static int y; } void main() { A.y = 42; // works A a; // a.x = 42; // fails A.B b; b.x = 42; // works } ------------------------------------- Applying const/immutable qualifier to aggregate definition propagates it only to fields and methods of struct/class. static fields and nested definitions are left mutable which is extremely confusing and inconsistent with usual transitivity.
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18632 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB