FIR: unwrap intersection overrides when looking for owner class
But not substitution overrides! This is important if the method called is an intersection override where one of the intersected types is a subtype of a generic type.
This commit is contained in:
@@ -148,9 +148,12 @@ abstract class FirVisibilityChecker : FirSessionComponent {
|
||||
): FirClassLikeDeclaration? {
|
||||
return when (this) {
|
||||
is FirCallableDeclaration -> {
|
||||
if (dispatchReceiverValue != null && dispatchReceiverType != null) {
|
||||
dispatchReceiverValue.type.findClassRepresentation(dispatchReceiverType!!, session)?.toSymbol(session)?.fir?.let {
|
||||
return it
|
||||
if (dispatchReceiverValue != null) {
|
||||
val baseReceiverType = dispatchReceiverClassTypeOrNull()
|
||||
if (baseReceiverType != null) {
|
||||
dispatchReceiverValue.type.findClassRepresentation(baseReceiverType, session)?.toSymbol(session)?.fir?.let {
|
||||
return it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user