JetBrains / resharper-unity

Unity support for both ReSharper and Rider
Apache License 2.0
1.21k stars 131 forks source link

unwarranted "Co-variant array conversion from Transform[] to Object[]" warning #2437

Open benblo opened 3 months ago

benblo commented 3 months ago

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.