<div dir="ltr">A work-around of that type required by a core language feature is not a sign of quality...<div><br></div><div>It get's me every single time, and I forget and have to go and find out why again each time.<br>
</div><div><div>Please, fix it finally.</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 11 November 2013 18:33, simendsjo <span dir="ltr"><<a href="mailto:simendsjo@gmail.com" target="_blank">simendsjo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Monday, 11 November 2013 at 08:30:32 UTC, Manu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
immutable string[string] priorityMap = [<br>
"1" : "blocker",<br>
"2" : "critical",<br>
"3" : "critical",<br>
"4" : "major",<br>
"5" : "major",<br>
"6" : "major",<br>
"7" : "minor",<br>
"8" : "minor",<br>
"9" : "trivial" ];<br>
<br>
main.d(56): Error: non-constant expression ["1":"blocker", "2":"critical",<br>
"3":"critical", "4":"major", "5":"major", "6":"major", "7":"minor",<br>
"8":"minor", "9":"trivial"]<br>
<br>
This is tedious, how long has it been now?<br>
Seriously, static map's are super-important, they should be able to be made<br>
immutable, and also be able to be initialised.<br>
<br>
Maybe this could be factored into the improvements for 2.065?<br>
</blockquote>
<br></div></div>
The workaround is simple at global scope, but I agree it clutters the code:<br>
<br>
immutable string[string] priorityMap;<br>
shared static this() {<div class="HOEnZb"><div class="h5"><br>
priorityMap = [<br>
"1" : "blocker",<br>
"2" : "critical",<br>
"3" : "critical",<br>
"4" : "major",<br>
"5" : "major",<br>
"6" : "major",<br>
"7" : "minor",<br>
"8" : "minor",<br>
"9" : "trivial" ];<br>
}<br>
</div></div></blockquote></div><br></div>