Extension operator function should be automatically imported for java function with the same name (KT-9406)
There's no need to import extension for Java operators anymore. Import for Kotlin functions. #KT-9406 Fixed
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
// FILE: first.before.kt
|
||||
// "Import" "true"
|
||||
|
||||
package testing
|
||||
|
||||
import some.Some
|
||||
|
||||
fun foo(): Some = Some()
|
||||
|
||||
fun testing() {
|
||||
foo()<caret>["str"]
|
||||
}
|
||||
|
||||
|
||||
|
||||
// FILE: second.kt
|
||||
package some
|
||||
|
||||
public class Some {
|
||||
fun get(s: String) {}
|
||||
}
|
||||
|
||||
operator fun Some.get(s: String) {}
|
||||
|
||||
|
||||
|
||||
// FILE: first.after.kt
|
||||
// "Import" "true"
|
||||
|
||||
package testing
|
||||
|
||||
import some.Some
|
||||
import some.get
|
||||
|
||||
fun foo(): Some = Some()
|
||||
|
||||
fun testing() {
|
||||
foo()<caret>["str"]
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user