Fix EA-60377 - readAccess for isSubclass

This commit is contained in:
Natalia Ukhorskaya
2014-11-07 16:08:25 +03:00
parent e82eb38ec3
commit a86e0336c9
@@ -30,6 +30,7 @@ import org.jetbrains.jet.lang.types.JetType
import org.jetbrains.jet.lang.resolve.DescriptorUtils
import org.jetbrains.jet.lang.descriptors.ClassDescriptor
import org.apache.log4j.Logger
import org.jetbrains.jet.plugin.util.application.runReadAction
class KotlinEvaluateExpressionCache(val project: Project) {
@@ -79,7 +80,7 @@ class KotlinEvaluateExpressionCache(val project: Project) {
val thisDescriptor = value.asmType.getClassDescriptor(project)
val superClassDescriptor = jetType.getConstructor().getDeclarationDescriptor() as? ClassDescriptor
return@all thisDescriptor != null && superClassDescriptor != null && DescriptorUtils.isSubclass(thisDescriptor, superClassDescriptor)
return@all thisDescriptor != null && superClassDescriptor != null && runReadAction { DescriptorUtils.isSubclass(thisDescriptor, superClassDescriptor) }!!
}
}