LL API: fix kt -> fir mapping for KtObjectLiteralExpression

This commit is contained in:
Ilya Kirillov
2021-07-14 19:34:34 +02:00
committed by teamcityserver
parent 32baac52e6
commit 9d53ad4346
4 changed files with 25 additions and 0 deletions
@@ -48,6 +48,7 @@ internal class FirElementBuilder {
// null will be return in case of invalid KtValueArgument
deparenthesized.getArgumentExpression()
}
deparenthesized is KtObjectLiteralExpression -> deparenthesized.objectDeclaration
else -> deparenthesized
}
}
@@ -0,0 +1,3 @@
// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtObjectLiteralExpression
val x = <expr>object : Any {}</expr>
@@ -0,0 +1,10 @@
KT element: KtObjectLiteralExpression
FIR element: FirAnonymousObjectExpressionImpl
FIR element rendered:
object : R|kotlin/Any| {
private constructor(): R|<anonymous>| {
super<R|kotlin/Any|>()
}
}
@@ -108,6 +108,17 @@ public class GetOrBuildFirTestGenerated extends AbstractGetOrBuildFirTest {
}
}
@Nested
@TestMetadata("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/getOrBuildFir/expressions")
@TestDataPath("$PROJECT_ROOT")
public class Expressions {
@Test
@TestMetadata("objectLiteralExpression.kt")
public void testObjectLiteralExpression() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/getOrBuildFir/expressions/objectLiteralExpression.kt");
}
}
@Nested
@TestMetadata("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/getOrBuildFir/inImport")
@TestDataPath("$PROJECT_ROOT")