Without further context, that looks like a property setter. There’s absolutely nothing wrong with thinking that the property setter sets the property immediately.
What you’re saying amounts to “functions/methods can do whatever they want, and assuming they do what they claim to do is an obvious mistake.”
What you’re saying amounts to “functions/methods can do whatever they want, and assuming they do what they claim to do is an obvious mistake.”