"Replace 'if' with elvis operator": don't suggest if val initializer is a complex expression
#KT-35165 Fixed
This commit is contained in:
committed by
Yan Zhulanow
parent
653e20dcba
commit
86ac44c23e
+12
@@ -0,0 +1,12 @@
|
||||
// PROBLEM: none
|
||||
private fun foo(arg: Any): Int {
|
||||
val x =
|
||||
if (arg is String)
|
||||
(arg.length + 1)
|
||||
else
|
||||
arg.hashCode()
|
||||
|
||||
if (<caret>x == null) return 0
|
||||
|
||||
return x
|
||||
}
|
||||
Reference in New Issue
Block a user