[LL] Add getOrBuildFir test for deserialized enum entry annotation argument

- The `getOrBuildFir` test clearly shows the difference between the
  unresolved enum entry and the resolved one (see the next commit).

^KT-63330
This commit is contained in:
Marco Pennekamp
2024-01-31 21:12:31 +01:00
committed by Space Team
parent acf828621a
commit a38d613dc3
5 changed files with 79 additions and 0 deletions
@@ -0,0 +1,25 @@
// KT-63330
// SKIP_WHEN_OUT_OF_CONTENT_ROOT
// MODULE: library1
// MODULE_KIND: LibraryBinary
// FILE: EnumClass.kt
enum class EnumClass {
First, Second
}
@Target(AnnotationTarget.TYPE)
annotation class Anno(val enumEntry: EnumClass)
// MODULE: library2(library1)
// MODULE_KIND: LibraryBinary
// FILE: Usage.kt
class Usage
val usage: @Anno(EnumClass.First) Usage = Usage()
// MODULE: main(library1, library2)
// FILE: main.kt
fun foo() {
<expr>val x = usage</expr>
}
@@ -0,0 +1,12 @@
KT element: KtProperty
FIR element: FirPropertyImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
[ResolvedTo(BODY_RESOLVE)] lval x: R|@R|Anno|(enumEntry = ) Usage| = R|/usage|
FIR FILE:
FILE: [ResolvedTo(IMPORTS)] main.kt
public final [ResolvedTo(BODY_RESOLVE)] fun foo(): R|kotlin/Unit| {
[ResolvedTo(BODY_RESOLVE)] lval x: R|@R|Anno|(enumEntry = ) Usage| = R|/usage|
}