struct S { int[] a; } enum s = S(new int[1]); int[1] a = s.a; void main() { } onlineapp.d(8): Error: cannot cast expression S([0]).a of type int[] to int[1] Compiles if S is constructed directly in the initializer: int[1] a = S(new int[1]).a; // ok
Workaround - use `[]`: int[1] a = s.a[];