Thanks @rlkoshak but it doesn’t work:
Using a variable of type Map<Object, State> as the argument for restoreStates() yields the type mismatch error below:
Type mismatch: cannot convert from Map<Object, State> to Map<Item, State>
I came up with the following ugly workround -
val Map<GenericItem, State> statesGeneric = callScript("myScriptName") as Map<GenericItem, State>
val states = storeStates()
states.putAll(statesGeneric)
restoreStates(states)
This is both ugly and still causes a validation issue warning in the log:
Map is a raw type. References to generic type Map<K, V> should be parameterized
but I can’t see any other way to achieve this while restoreStates() relies on a type that cannot be defined in the DSL.