From 5f6e5c5779def5073a4e79f79a91f5ffebad1450 Mon Sep 17 00:00:00 2001 From: Nicolay Mitropolsky Date: Thu, 30 Nov 2017 22:05:20 +0300 Subject: [PATCH] Uast: `AbstractKotlinUClass` compilation fix --- .../src/org/jetbrains/uast/kotlin/declarations/KotlinUClass.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUClass.kt b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUClass.kt index 2a204168c12..640e4f718e0 100644 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUClass.kt +++ b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/declarations/KotlinUClass.kt @@ -35,7 +35,7 @@ abstract class AbstractKotlinUClass(private val givenParent: UElement?) : Abstra override val uastParent: UElement? by lz { givenParent ?: convertParent() } //TODO: should be merged with KotlinAbstractUElement.convertParent() after detaching from AbstractJavaUClass - open fun convertParent(): UElement? = + override fun convertParent(): UElement? = (this.psi as? KtLightClassForLocalDeclaration)?.kotlinOrigin?.parent?.let { when (it) { is KtClassBody -> it.parent.toUElement() // TODO: it seems that `class_body`-s are never created in kotlin uast in top-down walk, probably they should be completely skipped and always unwrapped