FIR UAST: unify UMethod creation
This commit is contained in:
committed by
Ilya Kirillov
parent
5ec5b7f041
commit
638b0beadb
+4
-10
@@ -29,9 +29,9 @@ class FirKotlinUMethod(
|
|||||||
psi: KtLightMethod,
|
psi: KtLightMethod,
|
||||||
givenParent: UElement?
|
givenParent: UElement?
|
||||||
): UMethod {
|
): UMethod {
|
||||||
return when (psi) {
|
return when (val kotlinOrigin = psi.kotlinOrigin) {
|
||||||
is KtConstructor<*> ->
|
is KtConstructor<*> ->
|
||||||
FirKotlinConstructorUMethod(psi.containingClassOrObject, psi, givenParent)
|
FirKotlinConstructorUMethod(kotlinOrigin.containingClassOrObject, psi, givenParent)
|
||||||
// TODO: FirKotlinUAnnotationMethod
|
// TODO: FirKotlinUAnnotationMethod
|
||||||
else ->
|
else ->
|
||||||
FirKotlinUMethod(psi, givenParent)
|
FirKotlinUMethod(psi, givenParent)
|
||||||
@@ -48,14 +48,8 @@ class FirKotlinUMethod(
|
|||||||
is KtFunction ->
|
is KtFunction ->
|
||||||
LightClassUtil.getLightClassMethod(sourcePsi)
|
LightClassUtil.getLightClassMethod(sourcePsi)
|
||||||
else -> null
|
else -> null
|
||||||
} ?: return null
|
} as? KtLightMethod ?: return null
|
||||||
return when (sourcePsi) {
|
return create(javaPsi, givenParent)
|
||||||
is KtConstructor<*> ->
|
|
||||||
FirKotlinConstructorUMethod(sourcePsi.containingClassOrObject, javaPsi, sourcePsi, givenParent)
|
|
||||||
// TODO: FirKotlinUAnnotationMethod
|
|
||||||
else ->
|
|
||||||
FirKotlinUMethod(javaPsi, sourcePsi, givenParent)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user