Fix nullability quick-fixes with implicit receiver #KT-17726 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
9d2ae54d2c
commit
46aaee5d05
@@ -0,0 +1,6 @@
|
||||
// "Replace with safe (?.) call" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(array: Array<String>?) {
|
||||
array<caret>[0]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Replace with safe (?.) call" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(array: Array<String>?) {
|
||||
array?.get(0)
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Replace with safe (?.) call" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(array: Array<String>?) {
|
||||
array<caret>[0] = ""
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Replace with safe (?.) call" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(array: Array<String>?) {
|
||||
array?.set(0, "")
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Replace with safe (?.) call" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(bar: Int?) {
|
||||
bar +<caret> 1
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Replace with safe (?.) call" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(bar: Int?) {
|
||||
bar?.plus(1)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Replace with safe (?.) call" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {}
|
||||
|
||||
fun bar() {
|
||||
val fff: (() -> Unit)? = ::foo
|
||||
<caret>fff()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Replace with safe (?.) call" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {}
|
||||
|
||||
fun bar() {
|
||||
val fff: (() -> Unit)? = ::foo
|
||||
fff?.invoke()
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Replace with safe (?.) call" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(list: List<String>?) {
|
||||
list<caret>[0]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Replace with safe (?.) call" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(list: List<String>?) {
|
||||
list?.get(0)
|
||||
}
|
||||
Reference in New Issue
Block a user