[SLC] generate static enum methods from symbols
^KT-55496 Fixed
This commit is contained in:
committed by
Space Team
parent
c28e9d5253
commit
7d0c093da7
+3
-1
@@ -31,6 +31,7 @@ class KotlinClassInnerStuffCache(
|
||||
private val myClass: KtExtensibleLightClass,
|
||||
private val dependencies: List<Any>,
|
||||
private val lazyCreator: LazyCreator,
|
||||
private val generateEnumMethods: Boolean = true,
|
||||
) {
|
||||
abstract class LazyCreator {
|
||||
abstract fun <T : Any> get(initializer: () -> T, dependencies: List<Any>): Lazy<T>
|
||||
@@ -55,13 +56,14 @@ class KotlinClassInnerStuffCache(
|
||||
private val methodsCache = cache {
|
||||
val own = myClass.ownMethods
|
||||
var ext = collectAugments(myClass, PsiMethod::class.java)
|
||||
if (myClass.isEnum) {
|
||||
if (generateEnumMethods && myClass.isEnum) {
|
||||
ext = ArrayList<PsiMethod>(ext.size + 2).also {
|
||||
it += ext
|
||||
it.addIfNotNull(getValuesMethod())
|
||||
it.addIfNotNull(getValueOfMethod())
|
||||
}
|
||||
}
|
||||
|
||||
ArrayUtil.mergeCollections(own, ext, PsiMethod.ARRAY_FACTORY)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user