LL API: fix kt -> fir mapping of type inside nullable type

This commit is contained in:
Ilya Kirillov
2021-07-16 10:22:08 +02:00
committed by teamcityserver
parent ddd257adc2
commit 1423aa2c43
4 changed files with 14 additions and 0 deletions
@@ -50,6 +50,7 @@ internal class FirElementBuilder {
}
deparenthesized is KtObjectLiteralExpression -> deparenthesized.objectDeclaration
deparenthesized is KtStringTemplateEntryWithExpression -> deparenthesized.expression
deparenthesized is KtUserType && deparenthesized.parent is KtNullableType -> deparenthesized.parent as KtNullableType
else -> deparenthesized
}
}
@@ -0,0 +1,2 @@
fun x(): <expr>Int</expr>? = TODO()
@@ -0,0 +1,5 @@
KT element: KtUserType
FIR element: FirResolvedTypeRefImpl
FIR element rendered:
R|kotlin/Int?|
@@ -475,6 +475,12 @@ public class GetOrBuildFirTestGenerated extends AbstractGetOrBuildFirTest {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/getOrBuildFir/types/nestedTypeArgument.kt");
}
@Test
@TestMetadata("nullableTypeWithooutQuestionMark.kt")
public void testNullableTypeWithooutQuestionMark() throws Exception {
runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/getOrBuildFir/types/nullableTypeWithooutQuestionMark.kt");
}
@Test
@TestMetadata("typeArgument.kt")
public void testTypeArgument() throws Exception {