We get a "Co-variant array conversion from Transform[] to Object[] can cause run-time exception on write operation" warning when using eg Undo.RecordObjects(transforms, "Edit Transforms"); (passing a Transform[] when the method signature only takes Object[]).
I understand why this happens, but in this case it's unwarranted because the array we pass will only be read, not written to. I'm sure there are more such examples in the Unity API.
Is there a mechanism in Resharper to white-list methods for warnings? external annotations?
If so, is there such a Unity-specific whitelist we can edit somewhere / send a PR?
We get a "Co-variant array conversion from Transform[] to Object[] can cause run-time exception on write operation" warning when using eg
Undo.RecordObjects(transforms, "Edit Transforms");
(passing aTransform[]
when the method signature only takesObject[]
).I understand why this happens, but in this case it's unwarranted because the array we pass will only be read, not written to. I'm sure there are more such examples in the Unity API.