umka-lang
umka-lang copied to clipboard
"Map literals are not allowed for constants" outside of constants.
When defining a global variable:
numpadPaths := map[[2]char]str{}
keypadPaths := map[[2]char]str{}
For some reason it's treated as a constant.
In Umka, no code can be executed outside functions, except for the initial jump to the main entry point. Therefore, you can use only constant expressions to initialize global variables. Since your expressions are trivially zeros, you can just write
var numpadPaths, keypadPaths: map[[2]char]str
However, it would be nice to support constant expressions for maps, as I do it for dynamic arrays.