Create from Usage: Fix generation of extensions with nullable receiver

#KT-23796 Fixed
This commit is contained in:
Alexey Sedunov
2018-04-17 15:42:09 +03:00
parent 4e3c1e9f56
commit a4a10c7ba4
7 changed files with 57 additions and 6 deletions
@@ -0,0 +1,4 @@
// "Create extension function 'String?.notExistingFun'" "true"
fun context(p: String?) {
p.<caret>notExistingFun()
}
@@ -0,0 +1,8 @@
// "Create extension function 'String?.notExistingFun'" "true"
fun context(p: String?) {
p.notExistingFun()
}
private fun String?.notExistingFun() {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -0,0 +1,6 @@
// "Create extension property 'String?.notExistingVal'" "true"
fun foo(n: Int) {}
fun context(p: String?) {
foo(p.<caret>notExistingVal)
}
@@ -0,0 +1,11 @@
// "Create extension property 'String?.notExistingVal'" "true"
fun foo(n: Int) {}
fun context(p: String?) {
foo(p.notExistingVal)
}
private val String?.notExistingVal: Int
get() {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}