Add an editor warning when the variable's value is not modified in a setter or when nothing is returned from a getter #4905
mieldepoche
started this conversation in
Scripting
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Setter can sometimes contain complex logic and it's easy to forget to actually change the variable's value, especially when the setter's code contains "reaction" logic (as opposed to "validation" logic).
What about having an editor warning show up when the setter does not contains any
x = ...
statement?Such warning could of course be dismissed with a proper anotation (not sure which exaclty).
Similarly, a getter can return nothing (
null
):What about treating it the same as a regular methods, by showing an error when there's a path in which no explicit
return
is met?Beta Was this translation helpful? Give feedback.
All reactions