v
v copied to clipboard
map: declaration can't be done during initialization
V version: v 0.1.18 OS: (Arch) Linux
The problem
mut m := map[string]f32
m = {
'one': 1.0,
'one & a half': 1.5,
'two': 2.0
}
This code works perfectly fine. This however, does not:
m := {
'one': 1.0,
'one & a half': 1.5,
'two': 2.0
}
Apparantly, you can only declare a map after initializing it. This is not the case for a map of type map[string]int however. That makes it unexpected behaviour.
This has been resolved by #1753, thank you @Danil-Lapirow! :1st_place_medal: