diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinAbstractUElement.kt b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinAbstractUElement.kt index 1f6878c5ae3..9f7abbb111c 100644 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinAbstractUElement.kt +++ b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/KotlinAbstractUElement.kt @@ -103,6 +103,10 @@ abstract class KotlinAbstractUElement(private val givenParent: UElement?) : Kotl parent = parent?.parent } + if (parent is KtPropertyDelegate) { + parent = parent.parent + } + val result = doConvertParent(this, parent) if (result == this) { throw IllegalStateException("Loop in parent structure when converting a $psi of type ${psi?.javaClass} with parent $parent of type ${parent?.javaClass} text: [${parent?.text}]") diff --git a/plugins/uast-kotlin/tests/SimpleKotlinRenderLogTest.kt b/plugins/uast-kotlin/tests/SimpleKotlinRenderLogTest.kt index 217297a5a3a..3975af4287e 100644 --- a/plugins/uast-kotlin/tests/SimpleKotlinRenderLogTest.kt +++ b/plugins/uast-kotlin/tests/SimpleKotlinRenderLogTest.kt @@ -29,7 +29,7 @@ class SimpleKotlinRenderLogTest : AbstractKotlinRenderLogTest() { @Test fun testQualifiedConstructorCall() = doTest("QualifiedConstructorCall") - @Test fun testPropertyDelegate() = doTest("PropertyDelegate") { testName, file -> check(testName, file, false) } + @Test fun testPropertyDelegate() = doTest("PropertyDelegate") @Test fun testLocalVariableWithAnnotation() = doTest("LocalVariableWithAnnotation")