From 1dca49cecc5135cd2b9c5f51afea4f1679088ace Mon Sep 17 00:00:00 2001 From: Stanislav Erokhin Date: Fri, 27 Nov 2015 16:09:09 +0300 Subject: [PATCH] Workaround for tower resolution algorithm in kotlin code. Will be investigated. --- .../java/lazy/descriptors/LazyJavaClassMemberScope.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt index 3577d88b127..447ed9196fc 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt @@ -51,6 +51,7 @@ import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.resolve.OverridingUtil import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter import org.jetbrains.kotlin.serialization.deserialization.ErrorReporter +import org.jetbrains.kotlin.storage.NotNullLazyValue import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.TypeUtils import org.jetbrains.kotlin.types.checker.KotlinTypeChecker @@ -583,10 +584,11 @@ public class LazyJavaClassMemberScope( if (jNestedClass == null) { val field = enumEntryIndex()[name] if (field != null) { + val createLazyValue: NotNullLazyValue> = c.storageManager.createLazyValue { + memberIndex().getAllFieldNames() + memberIndex().getMethodNames({ true }) + } EnumEntrySyntheticClassDescriptor.create(c.storageManager, ownerDescriptor, name, - c.storageManager.createLazyValue { - memberIndex().getAllFieldNames() + memberIndex().getMethodNames({ true }) - }, c.resolveAnnotations(field), c.components.sourceElementFactory.source(field)) + createLazyValue, c.resolveAnnotations(field), c.components.sourceElementFactory.source(field)) } else null }