immutable ubyte[4] data = [1, 2, 3, 4];
Using a static array instead of a slice will do the trick. You can leave the `__gshared` if you want, but it is redundant on a global, initialized `immutable` variable.
Mathias LANG via Digitalmars-d-learn Wed, 05 Apr 2023 18:01:53 -0700
immutable ubyte[4] data = [1, 2, 3, 4];
Using a static array instead of a slice will do the trick. You can leave the `__gshared` if you want, but it is redundant on a global, initialized `immutable` variable.