I wrote in a module:
import Map "mo:base/OrderedMap";
...
module {
...
let stringMap = Map.Make<Text>();
...
}
and got the error: non-static expression in library, module or migration expression Motoko(M0014)
.
What should I do in this situation? Which of the following is better?
func stringMap(): Map.Operations<Text> {
Map.Make<Text>();
}
- Write
Map.Make<Text>()
in every function that uses it.
Other variants?
See also my older question: Peculiarities of using `OrderedMap` in a structure