[fir2ir] Fix annotation conversion on partial module compilation

Backend requires annotation constructors to be fully resolved for the
'IrConst' default value lowering. However, in the IDE there is usually
no need in complete annotation class resolution.

^KTIJ-27061 Fixed
This commit is contained in:
Yan Zhulanow
2023-09-14 19:06:18 +09:00
committed by Space Team
parent 480bac7537
commit 40ecd4bc1e
7 changed files with 55 additions and 0 deletions
@@ -0,0 +1,13 @@
MODULE_FRAGMENT
FILE fqName:<root> fileName:fragment.kt
CLASS CLASS name:CodeFragment modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.CodeFragment
CONSTRUCTOR visibility:public <> () returnType:<root>.CodeFragment [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
FUN name:run visibility:public modality:FINAL <> () returnType:kotlin.Int
EXPRESSION_BODY
BLOCK type=kotlin.Int origin=null
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
$this: CALL 'public final fun foo (): kotlin.Int declared in <root>.MainKt' type=kotlin.Int origin=null
other: CALL 'public final fun bar (): kotlin.Int declared in <root>.MainKt' type=kotlin.Int origin=null
@@ -0,0 +1,18 @@
// FILE: lib.kt
package lib
@Target(AnnotationTarget.FUNCTION)
annotation class Anno(val x: String = "foo")
// FILE: main.kt
import lib.Anno
@Anno
fun foo(): Int = 5
@Anno(x = "bar")
fun bar(): Int = 10
fun test() {
<caret>val x = 0
}
@@ -0,0 +1,5 @@
public final class CodeFragment {
// source: 'fragment.kt'
public method <init>(): void
public final static method run(): int
}