Preserve synthetic enum methods in stub-based 'ClsClassImpl'
'ClsClassImpl' instances created by the platform contain synthetic enum methods (added by 'ClassInnerStuffCache.calcMethods()'). Such convention is common in IntelliJ (see KT-36095 and '9a8b345adaded83fe13980a28db5d9f9acc7450d' in the IntelliJ repository). This commit makes Kotlin's stub-based classes consistent with the convention. Instead, a filter is added in place of 'ClsClassImpl' usage. See also the following commits: -7c86911f44-43468c6d55
This commit is contained in:
+3
-1
@@ -18,6 +18,7 @@ import org.jetbrains.kotlin.analyzer.KotlinModificationTrackerService
|
||||
import org.jetbrains.kotlin.asJava.classes.KotlinClassInnerStuffCache
|
||||
import org.jetbrains.kotlin.asJava.classes.LightClassesLazyCreator
|
||||
import org.jetbrains.kotlin.asJava.classes.lazyPub
|
||||
import org.jetbrains.kotlin.asJava.isSyntheticValuesOrValueOfMethod
|
||||
import org.jetbrains.kotlin.load.java.structure.LightClassOriginKind
|
||||
import org.jetbrains.kotlin.psi.KtClassOrObject
|
||||
|
||||
@@ -155,7 +156,8 @@ open class KtLightClassForDecompiledDeclaration(
|
||||
|
||||
private val _methods: MutableList<PsiMethod> by lazyPub {
|
||||
mutableListOf<PsiMethod>().also {
|
||||
clsDelegate.methods.mapTo(it) { psiMethod ->
|
||||
clsDelegate.methods.mapNotNullTo(it) { psiMethod ->
|
||||
if (isSyntheticValuesOrValueOfMethod(psiMethod)) return@mapNotNullTo null
|
||||
KtLightMethodForDecompiledDeclaration(
|
||||
funDelegate = psiMethod,
|
||||
funParent = this,
|
||||
|
||||
Reference in New Issue
Block a user