Auto-imports for index functions, += like operators, invoke, delegates and components
#KT-9482 Fixed #KT-9397 Fixed #KT-8060 Fixed
This commit is contained in:
committed by
Nikolay Krasko
parent
0f85d770dd
commit
2f26480e6b
+47
@@ -0,0 +1,47 @@
|
||||
// FILE: first.before.kt
|
||||
// "Import" "true"
|
||||
// ERROR: <html>Unresolved reference. <br/> None of the following candidates is applicable because of receiver type mismatch: <ul><li><b>public</b> operator <b>fun</b> kotlin.String?.plus(other: kotlin.Any?): kotlin.String <i>defined in</i> kotlin</li></ul></html>
|
||||
|
||||
package testing
|
||||
|
||||
import some.Some
|
||||
|
||||
fun testing() {
|
||||
var s = Some()
|
||||
s <caret>+= 1
|
||||
}
|
||||
|
||||
|
||||
|
||||
// FILE: second.kt
|
||||
package some
|
||||
|
||||
public class Some
|
||||
|
||||
operator fun Some.plusAssign(i: Int) {}
|
||||
|
||||
// FILE: second.kt
|
||||
// Lexicography is before "some"
|
||||
package aaa
|
||||
|
||||
import some.Some
|
||||
|
||||
operator fun Some.plus(i: Int) : Some = this
|
||||
|
||||
|
||||
// FILE: first.after.kt
|
||||
// "Import" "true"
|
||||
// ERROR: <html>Unresolved reference. <br/> None of the following candidates is applicable because of receiver type mismatch: <ul><li><b>public</b> operator <b>fun</b> kotlin.String?.plus(other: kotlin.Any?): kotlin.String <i>defined in</i> kotlin</li></ul></html>
|
||||
|
||||
package testing
|
||||
|
||||
import some.Some
|
||||
import some.plusAssign
|
||||
|
||||
fun testing() {
|
||||
var s = Some()
|
||||
s <caret>+= 1
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user