Import quick fix: suggest for operator extension function called from name reference
#KT-28049 Fixed
This commit is contained in:
committed by
Dmitry Gridin
parent
998adfb098
commit
79199260b9
@@ -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()
|
||||
}
|
||||
//-----------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user