Kapt: asMemberOf() should also check the containing type itself, not only its supertypes (KT-13823)
(cherry picked from commit 9f9ffdf)
This commit is contained in:
committed by
Yan Zhulanow
parent
cb9dc21649
commit
415acfbd05
+7
-2
@@ -250,9 +250,14 @@ class KotlinTypes(
|
||||
val containingType = containing.psiType
|
||||
|
||||
val member = (element as JeElement).psi as? PsiMember ?: return element.asType()
|
||||
val methodContainingClass = member.containingClass ?: return element.asType()
|
||||
val memberContainingClass = member.containingClass ?: return element.asType()
|
||||
|
||||
val relevantSuperType = if (memberContainingClass == containingType.resolve()) {
|
||||
containingType
|
||||
} else {
|
||||
containingType.superTypes.findSuperType(memberContainingClass) ?: return element.asType()
|
||||
}
|
||||
|
||||
val relevantSuperType = containingType.superTypes.findSuperType(methodContainingClass) ?: return element.asType()
|
||||
val resolveResult = relevantSuperType.resolveGenerics()
|
||||
if (!resolveResult.isValidResult) return element.asType()
|
||||
val substitutor = resolveResult.substitutor
|
||||
|
||||
Reference in New Issue
Block a user