Refactoring: make "if-then to safe access" an inspection
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// PROBLEM: none
|
||||
|
||||
fun maybeFoo(): String? {
|
||||
return "foo"
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val foo = maybeFoo()
|
||||
if (foo != null<caret>) {
|
||||
foo.length
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user