I have a scenario like this:
function TestStruct() constructor {
prop1 = 1;
prop2 = 2;
}
function Wrapper() constructor {
contents = {
a : new TestStruct(),
b : new TestStruct()
}
}
and if I add some extra definitions to the contents struct anywhere in the project (like below, where a custom property is passed via a constructor argument)
function Wrapper(myCustomProperty) constructor {
contents = {
a : new TestStruct(),
b : new TestStruct()
}
contents[$ myCustomProperty] = new TestStruct();
}
I get a warning at the closing brace of the contents struct which says:
Can't cast { a: TestStruct, b: TestStruct } to array<?> for assignment
It is less of a major inconvenience, but more so an oddity that leaves me with a warning for what appears to me to be correct code.