Import quick fix: suggest for operator extension function called from name reference

#KT-28049 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-09-17 06:30:26 +09:00
committed by Dmitry Gridin
parent 998adfb098
commit 79199260b9
3 changed files with 55 additions and 4 deletions
@@ -0,0 +1,42 @@
// FILE: first.before.kt
// "Import" "true"
// ERROR: Expression 'a' of type 'A' cannot be invoked as a function. The function 'invoke()' is not found
package b
import a.A
fun main() {
val a = A()
<caret>a()
}
//-----------------------
// FILE: second.kt
// "Import" "true"
// ERROR: Expression 'a' of type 'A' cannot be invoked as a function. The function 'invoke()' is not found
package a
class A
operator fun A.invoke() = 42
//-----------------------
// FILE: first.after.kt
// "Import" "true"
// ERROR: Expression 'a' of type 'A' cannot be invoked as a function. The function 'invoke()' is not found
package b
import a.A
import a.invoke
fun main() {
val a = A()
<caret>a()
}
//-----------------------