c463fad3b7
- it is required to be able to autoimport extensions from objects, not only from the top level - use `substituteExtensionIfCallable` to handle generics for extension methods - move finding expression receivers to the separate method, add `Receivers` value class to hold found receivers - change `CallableDescriptor.isValidByReceiversFor` to return false if explicit receiver is not required for the descriptor - ^KT-34000 Fixed
28 lines
489 B
Plaintext
Vendored
28 lines
489 B
Plaintext
Vendored
// "Import" "true"
|
|
package p
|
|
|
|
import p.TopLevelObject1.foobar
|
|
|
|
class T
|
|
class NotT
|
|
class NotTT
|
|
|
|
object TopLevelObject1 {
|
|
fun T.foobar() {}
|
|
}
|
|
|
|
object TopLevelObject2 {
|
|
fun NotT.foobar() {} // other type, should not be imported
|
|
}
|
|
|
|
object TopLevelObject3 {
|
|
fun foobar() {} // not an extension, should not be imported
|
|
}
|
|
|
|
object TopLevelObject4 {
|
|
fun NotTT.foobar() {} // NotTT present as receiver, but explicit receiver shuts him down
|
|
}
|
|
|
|
fun NotTT.usage(t: T) {
|
|
t.foobar()
|
|
} |