On Monday, 13 August 2018 at 13:21:45 UTC, Andrey wrote:
On Monday, 13 August 2018 at 11:53:06 UTC, rikki cattermole wrote:You must use a module constructor to initialize it.Tried this: static this() {Test.DESCRIPTION = [Test.Type.One: "One!", Test.Type.Two: "It's Two...", Test.Type.Three: "And... Three!"];} struct Test { // ... } I have an error: cannot modify immutable expression DESCRIPTION
What is your other code? It can work, e.g.: https://run.dlang.io/is/kAC4pl