// FULL_JDK // FILE: Descriptor.java public interface Descriptor // FILE: ResolvedCall.java import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public interface ResolvedCall { @NotNull D getResultingDescriptor(); @Nullable D getCandidateDescriptor(); } // FILE: test.kt val Descriptor.name = "123" fun Descriptor.correct(): Boolean = true fun Descriptor.foo() {} interface Call { val resultingDescriptor: D } fun test(call: Call, resolvedCall: ResolvedCall) { call.resultingDescriptor.name resolvedCall.resultingDescriptor.name val resolvedDescriptor = resolvedCall.candidateDescriptor if (resolvedDescriptor?.correct() != true) return resolvedDescriptor.foo() } fun otherTest(call: Call<*>, resolvedCall: ResolvedCall<*>) { call.resultingDescriptor.name resolvedCall.resultingDescriptor.name }