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
Some times I found functions that allows a null parameter to then assert that it's not null. Those functions shouldn't accept a null parameter, they should force the caller to take the decission to force the non-null or don't cal it.
Non-compilant
funfoo(a:String?) {
println(a!!)
}
This function should be declared like this:
funfoo(a:String) {
println(a)
}
Context
This kind of errors are added with the java to kotlin translator. And some times after a few refactor you can end up with code like this.
The text was updated successfully, but these errors were encountered:
Expected Behavior of the rule
Some times I found functions that allows a null parameter to then assert that it's not null. Those functions shouldn't accept a null parameter, they should force the caller to take the decission to force the non-null or don't cal it.
Non-compilant
This function should be declared like this:
Context
This kind of errors are added with the java to kotlin translator. And some times after a few refactor you can end up with code like this.
The text was updated successfully, but these errors were encountered: