55b3637f03
FakeCallableDescriptorForObject instance, which is not ConstructorDescriptor, is checked with call checkers when object's contents are being used. Checker of missing supertypes should not be run against this fake descriptor. Object's members belong to separate member scope, so their resolution doesn't force containing class' supertypes evaluation. I.e. object's methods may work fine even if some supertypes of containing class are missing.
28 lines
677 B
Kotlin
Vendored
28 lines
677 B
Kotlin
Vendored
import test.Sub as MySub
|
|
import test.SubKt
|
|
|
|
typealias Sub = MySub
|
|
|
|
class Test<T>
|
|
|
|
@Suppress("UNUSED_PARAMETER")
|
|
fun useCallRef(ref: Any?) {}
|
|
|
|
@Suppress("UNUSED_PARAMETER")
|
|
fun simpleFun(arg: Sub): Sub = Sub()
|
|
|
|
inline fun <reified T> inlineFun(t: T) = t
|
|
|
|
// Imports, aliases type references, constructor calls and callable references don't trigger supertype resolution.
|
|
// There should be no error for backward compatibility, despite the missing supertype.
|
|
fun test() {
|
|
@Suppress("UNUSED_VARIABLE")
|
|
val x: Sub = Sub()
|
|
Test<Sub>()
|
|
useCallRef(::Sub)
|
|
simpleFun(Sub())
|
|
inlineFun<Sub>(Sub())
|
|
SubKt.companionMethod()
|
|
SubKt.InnerObject.objectMethod()
|
|
}
|