Surround with null check : applicable also for TYPE_MISMATCH

This commit is contained in:
Mikhail Glukhikh
2016-06-13 15:56:41 +03:00
parent 10935ba9db
commit b1734920b6
5 changed files with 43 additions and 0 deletions
@@ -0,0 +1,7 @@
// "Surround with null check" "true"
fun foo(x: String?) {
bar(<caret>x)
}
fun bar(s: String) = s.hashCode()
@@ -0,0 +1,9 @@
// "Surround with null check" "true"
fun foo(x: String?) {
if (x != null) {
bar(x)
}
}
fun bar(s: String) = s.hashCode()