FIR: fix of super.methodOfAny resolve in case of one supertype
This commit is contained in:
@@ -36,12 +36,13 @@ fun BodyResolveComponents.findTypesForSuperCandidates(
|
||||
containingCall: FirQualifiedAccess,
|
||||
): Collection<ConeKotlinType> {
|
||||
val supertypes = superTypeRefs.map { (it as FirResolvedTypeRef).type }
|
||||
if (supertypes.size <= 1) return supertypes
|
||||
val isMethodOfAny = containingCall is FirFunctionCall && isCallingMethodOfAny(containingCall)
|
||||
if (supertypes.size <= 1 && !isMethodOfAny) return supertypes
|
||||
|
||||
return when (containingCall) {
|
||||
is FirFunctionCall -> {
|
||||
val calleeName = containingCall.calleeReference.name
|
||||
if (isCallingMethodOfAny(containingCall)) {
|
||||
if (isMethodOfAny) {
|
||||
resolveSupertypesForMethodOfAny(supertypes, calleeName)
|
||||
} else {
|
||||
resolveSupertypesByCalleeName(supertypes, calleeName)
|
||||
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
interface IWithToString {
|
||||
override fun toString(): String
|
||||
}
|
||||
|
||||
class A : IWithToString {
|
||||
// Should be Any#toString(), even though IWithToString defines an abstract toString.
|
||||
override fun toString(): String = super.<!ABSTRACT_SUPER_CALL!>toString<!>()
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
interface IWithToString {
|
||||
override fun toString(): String
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user