Fix nullability quick-fixes with implicit receiver #KT-17726 Fixed

This commit is contained in:
Dmitry Neverov
2017-05-21 07:07:43 +02:00
committed by Mikhail Glukhikh
parent 9d2ae54d2c
commit 46aaee5d05
44 changed files with 479 additions and 23 deletions
@@ -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)
}