introduceValue() always adds statement before except for safe call case
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fun String.<caret>f(p: Int) = hashCode() * p
|
||||
|
||||
fun f(s: String?) {
|
||||
s?.f(1)
|
||||
s?.substring(1)?.f(2)
|
||||
val s1 = s?.f(3)
|
||||
val s2 = s?.substring(1)?.f(4)
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fun f(s: String?) {
|
||||
if (s != null) {
|
||||
s.hashCode() * 1
|
||||
}
|
||||
val substring = s?.substring(1)
|
||||
if (substring != null) {
|
||||
substring.hashCode() * 2
|
||||
}
|
||||
val s1 = s?.let { it.hashCode() * 3 }
|
||||
val s2 = s?.substring(1)?.let { it.hashCode() * 4 }
|
||||
}
|
||||
Reference in New Issue
Block a user