It seems you can’t assign a value to a map of structs because the compiler thinks you want to modify the interior of the struct instead of replacing the struct wholesale in the map:
example_struct := struct:
something: int
example := class:
ExampleMap: [int]example_struct := map{}
Test():void =
if(set ExampleMap[0] = example_struct{something:= 0}):
The above code will error on the last line with The assignment's left hand expression type 'example_struct' cannot be assigned to(3509)
. It’s an odd error, since the struct does not exist yet in the map, seems like a type system problem.
Any ideas how to work around this?