Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
benblo opened this issue Mar 26, 2024 · 0 comments

Comments

@benblo
Copy link

benblo commented Mar 26, 2024

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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant