You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hm. Sometimes you have to put inout because you're, say, satisfying a protocol requirement. I wouldn't want to add a warning unless we had a way to silence it.
(The most obvious way I can think of is self-assignment, but I feel like normally we'd want to warn on that. The next is to use _ instead of a real param name, but that affects doc comments.)
Additional Detail from JIRA
md5: 3c7a5d4404735951bff2a03f808e31d0
Issue Description:
Using "var" and failing to mutate it results in the following warning:
Using "inout" and failing to mutate it results in no warning.
Shouldn't we have a warning here? If I forget to mutate an "inout" variable in a function, I've probably done something wrong.
I stumbled upon this when I defined a function that took an "inout" parameter but ended up copying it internally and mutating the copy.
The text was updated successfully, but these errors were encountered: