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
Rule 6.1.9: never use the name of a variable in the custom getter or setter
Even if you have ignored recommendation 6.1.8 you should be careful with using the name of the property in your custom getter/setter
as it can accidentally cause a recursive call and a StackOverflow Error. Use field keyword instead.
Very bad example:
var isEmpty:Boolean
set(value) {
println("Side effect")
isEmpty = value
}
get() = isEmpty
The text was updated successfully, but these errors were encountered:
Rule 6.1.9: never use the name of a variable in the custom getter or setter
Even if you have ignored recommendation 6.1.8 you should be careful with using the name of the property in your custom getter/setter
as it can accidentally cause a recursive call and a
StackOverflow Error
. Usefield
keyword instead.Very bad example:
The text was updated successfully, but these errors were encountered: