[FIR] move annotation recheck logic to ANNOTATIONS_ARGUMENTS_MAPPING phase

ARGUMENTS_OF_ANNOTATIONS will be dropped, so this check should be moved
This commit also drops class annotations resolution from implicit type
phase and provides the correct scope during argument mapping phase.
This code was effectively unreachable before

^KT-62679
This commit is contained in:
Dmitrii Gridin
2023-10-18 15:01:59 +02:00
committed by Space Team
parent 01905a5a06
commit a60777b9a7
8 changed files with 168 additions and 160 deletions
@@ -269,31 +269,27 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationConflict.kt
LAZY_super<R|kotlin/Any|>
}
@R|kotlin/annotation/Target|[Types](Q|Some.AnnotationTarget|.<
Annotation symbol resolved differently on compiler annotation and symbols stages:
- compiler annotations: FirEnumEntrySymbol kotlin/annotation/AnnotationTarget.CLASS
- compiler arguments stage: FirEnumEntrySymbol /Some.AnnotationTarget.CLASS
>#) public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] annotation class Ann : R|kotlin/Annotation| {
@R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|) public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] annotation class Ann : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Ann] constructor(): R|Some.Ann| {
LAZY_super<R|kotlin/Any|>
}
}
public final [ResolvedTo(STATUS)] enum class AnnotationTarget : R|kotlin/Enum<Some.AnnotationTarget>| {
private [ResolvedTo(STATUS)] [ContainingClassKey=AnnotationTarget] constructor(): R|Some.AnnotationTarget| {
public? final? [ResolvedTo(RAW_FIR)] enum class AnnotationTarget : R|kotlin/Enum<Some.AnnotationTarget>| {
private [ResolvedTo(RAW_FIR)] [ContainingClassKey=AnnotationTarget] constructor(): R|Some.AnnotationTarget| {
LAZY_super<R|kotlin/Enum<Some.AnnotationTarget>|>
}
public final static [ResolvedTo(STATUS)] [ContainingClassKey=AnnotationTarget] enum entry CLASS: R|Some.AnnotationTarget|
public final static [ResolvedTo(STATUS)] [ContainingClassKey=AnnotationTarget] fun values(): R|kotlin/Array<Some.AnnotationTarget>| {
public final static [ResolvedTo(RAW_FIR)] [ContainingClassKey=AnnotationTarget] enum entry CLASS: R|Some.AnnotationTarget|
public final static [ResolvedTo(RAW_FIR)] [ContainingClassKey=AnnotationTarget] fun values(): R|kotlin/Array<Some.AnnotationTarget>| {
}
public final static [ResolvedTo(STATUS)] [ContainingClassKey=AnnotationTarget] fun valueOf([ResolvedTo(STATUS)] value: R|kotlin/String|): R|Some.AnnotationTarget| {
public final static [ResolvedTo(RAW_FIR)] [ContainingClassKey=AnnotationTarget] fun valueOf([ResolvedTo(RAW_FIR)] value: R|kotlin/String|): R|Some.AnnotationTarget| {
}
public final static [ResolvedTo(STATUS)] [ContainingClassKey=AnnotationTarget] val entries: R|kotlin/enums/EnumEntries<Some.AnnotationTarget>|
public [ResolvedTo(STATUS)] get(): R|kotlin/enums/EnumEntries<Some.AnnotationTarget>|
public final static [ResolvedTo(RAW_FIR)] [ContainingClassKey=AnnotationTarget] val entries: R|kotlin/enums/EnumEntries<Some.AnnotationTarget>|
public [ResolvedTo(RAW_FIR)] get(): R|kotlin/enums/EnumEntries<Some.AnnotationTarget>|
}
@@ -306,31 +302,27 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationConflict.kt
LAZY_super<R|kotlin/Any|>
}
@R|kotlin/annotation/Target|[Types](Q|Some.AnnotationTarget|.<
Annotation symbol resolved differently on compiler annotation and symbols stages:
- compiler annotations: FirEnumEntrySymbol kotlin/annotation/AnnotationTarget.CLASS
- compiler arguments stage: FirEnumEntrySymbol /Some.AnnotationTarget.CLASS
>#) public final [ResolvedTo(CONTRACTS)] annotation class Ann : R|kotlin/Annotation| {
@R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|) public final [ResolvedTo(CONTRACTS)] annotation class Ann : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Ann] constructor(): R|Some.Ann| {
LAZY_super<R|kotlin/Any|>
}
}
public final [ResolvedTo(STATUS)] enum class AnnotationTarget : R|kotlin/Enum<Some.AnnotationTarget>| {
private [ResolvedTo(STATUS)] [ContainingClassKey=AnnotationTarget] constructor(): R|Some.AnnotationTarget| {
public? final? [ResolvedTo(RAW_FIR)] enum class AnnotationTarget : R|kotlin/Enum<Some.AnnotationTarget>| {
private [ResolvedTo(RAW_FIR)] [ContainingClassKey=AnnotationTarget] constructor(): R|Some.AnnotationTarget| {
LAZY_super<R|kotlin/Enum<Some.AnnotationTarget>|>
}
public final static [ResolvedTo(STATUS)] [ContainingClassKey=AnnotationTarget] enum entry CLASS: R|Some.AnnotationTarget|
public final static [ResolvedTo(STATUS)] [ContainingClassKey=AnnotationTarget] fun values(): R|kotlin/Array<Some.AnnotationTarget>| {
public final static [ResolvedTo(RAW_FIR)] [ContainingClassKey=AnnotationTarget] enum entry CLASS: R|Some.AnnotationTarget|
public final static [ResolvedTo(RAW_FIR)] [ContainingClassKey=AnnotationTarget] fun values(): R|kotlin/Array<Some.AnnotationTarget>| {
}
public final static [ResolvedTo(STATUS)] [ContainingClassKey=AnnotationTarget] fun valueOf([ResolvedTo(STATUS)] value: R|kotlin/String|): R|Some.AnnotationTarget| {
public final static [ResolvedTo(RAW_FIR)] [ContainingClassKey=AnnotationTarget] fun valueOf([ResolvedTo(RAW_FIR)] value: R|kotlin/String|): R|Some.AnnotationTarget| {
}
public final static [ResolvedTo(STATUS)] [ContainingClassKey=AnnotationTarget] val entries: R|kotlin/enums/EnumEntries<Some.AnnotationTarget>|
public [ResolvedTo(STATUS)] get(): R|kotlin/enums/EnumEntries<Some.AnnotationTarget>|
public final static [ResolvedTo(RAW_FIR)] [ContainingClassKey=AnnotationTarget] val entries: R|kotlin/enums/EnumEntries<Some.AnnotationTarget>|
public [ResolvedTo(RAW_FIR)] get(): R|kotlin/enums/EnumEntries<Some.AnnotationTarget>|
}
@@ -343,31 +335,27 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationConflict.kt
LAZY_super<R|kotlin/Any|>
}
@R|kotlin/annotation/Target|[Types](Q|Some.AnnotationTarget|.<
Annotation symbol resolved differently on compiler annotation and symbols stages:
- compiler annotations: FirEnumEntrySymbol kotlin/annotation/AnnotationTarget.CLASS
- compiler arguments stage: FirEnumEntrySymbol /Some.AnnotationTarget.CLASS
>#) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
@R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Ann] constructor(): R|Some.Ann| {
LAZY_super<R|kotlin/Any|>
}
}
public final [ResolvedTo(STATUS)] enum class AnnotationTarget : R|kotlin/Enum<Some.AnnotationTarget>| {
private [ResolvedTo(STATUS)] [ContainingClassKey=AnnotationTarget] constructor(): R|Some.AnnotationTarget| {
public? final? [ResolvedTo(RAW_FIR)] enum class AnnotationTarget : R|kotlin/Enum<Some.AnnotationTarget>| {
private [ResolvedTo(RAW_FIR)] [ContainingClassKey=AnnotationTarget] constructor(): R|Some.AnnotationTarget| {
LAZY_super<R|kotlin/Enum<Some.AnnotationTarget>|>
}
public final static [ResolvedTo(STATUS)] [ContainingClassKey=AnnotationTarget] enum entry CLASS: R|Some.AnnotationTarget|
public final static [ResolvedTo(STATUS)] [ContainingClassKey=AnnotationTarget] fun values(): R|kotlin/Array<Some.AnnotationTarget>| {
public final static [ResolvedTo(RAW_FIR)] [ContainingClassKey=AnnotationTarget] enum entry CLASS: R|Some.AnnotationTarget|
public final static [ResolvedTo(RAW_FIR)] [ContainingClassKey=AnnotationTarget] fun values(): R|kotlin/Array<Some.AnnotationTarget>| {
}
public final static [ResolvedTo(STATUS)] [ContainingClassKey=AnnotationTarget] fun valueOf([ResolvedTo(STATUS)] value: R|kotlin/String|): R|Some.AnnotationTarget| {
public final static [ResolvedTo(RAW_FIR)] [ContainingClassKey=AnnotationTarget] fun valueOf([ResolvedTo(RAW_FIR)] value: R|kotlin/String|): R|Some.AnnotationTarget| {
}
public final static [ResolvedTo(STATUS)] [ContainingClassKey=AnnotationTarget] val entries: R|kotlin/enums/EnumEntries<Some.AnnotationTarget>|
public [ResolvedTo(STATUS)] get(): R|kotlin/enums/EnumEntries<Some.AnnotationTarget>|
public final static [ResolvedTo(RAW_FIR)] [ContainingClassKey=AnnotationTarget] val entries: R|kotlin/enums/EnumEntries<Some.AnnotationTarget>|
public [ResolvedTo(RAW_FIR)] get(): R|kotlin/enums/EnumEntries<Some.AnnotationTarget>|
}
@@ -157,11 +157,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationConflict2.kt
LAZY_super<R|kotlin/Any|>
}
@R|kotlin/annotation/Target|[Types](<
Annotation symbol resolved differently on compiler annotation and symbols stages:
- compiler annotations: FirEnumEntrySymbol kotlin/annotation/AnnotationTarget.FIELD
- compiler arguments stage: null
>#) public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] annotation class Ann : R|kotlin/Annotation| {
@R|kotlin/annotation/Target|[Types](R|kotlin/annotation/AnnotationTarget.FIELD|) public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] annotation class Ann : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Ann] constructor(): R|Some.Ann| {
LAZY_super<R|kotlin/Any|>
}
@@ -180,11 +176,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationConflict2.kt
LAZY_super<R|kotlin/Any|>
}
@R|kotlin/annotation/Target|[Types](<
Annotation symbol resolved differently on compiler annotation and symbols stages:
- compiler annotations: FirEnumEntrySymbol kotlin/annotation/AnnotationTarget.FIELD
- compiler arguments stage: null
>#) public final [ResolvedTo(CONTRACTS)] annotation class Ann : R|kotlin/Annotation| {
@R|kotlin/annotation/Target|[Types](R|kotlin/annotation/AnnotationTarget.FIELD|) public final [ResolvedTo(CONTRACTS)] annotation class Ann : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Ann] constructor(): R|Some.Ann| {
LAZY_super<R|kotlin/Any|>
}
@@ -203,11 +195,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationConflict2.kt
LAZY_super<R|kotlin/Any|>
}
@R|kotlin/annotation/Target|[Types](<
Annotation symbol resolved differently on compiler annotation and symbols stages:
- compiler annotations: FirEnumEntrySymbol kotlin/annotation/AnnotationTarget.FIELD
- compiler arguments stage: null
>#) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
@R|kotlin/annotation/Target|[Types](R|kotlin/annotation/AnnotationTarget.FIELD|) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Ann] constructor(): R|Some.Ann| {
LAZY_super<R|kotlin/Any|>
}
@@ -226,19 +214,19 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationConflict2.kt
LAZY_super<R|kotlin/Any|>
}
@R|kotlin/annotation/Target|[Types](allowedTargets = vararg(<
@R|kotlin/annotation/Target|[Types](allowedTargets = this@R|/Some|.<
Annotation symbol resolved differently on compiler annotation and symbols stages:
- compiler annotations: FirEnumEntrySymbol kotlin/annotation/AnnotationTarget.FIELD
- compiler arguments stage: null
>#)) public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] annotation class Ann : R|kotlin/Annotation| {
- compiler arguments stage: FirPropertySymbol /Some.FIELD
>#) public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] annotation class Ann : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Ann] constructor(): R|Some.Ann| {
LAZY_super<R|kotlin/Any|>
}
}
public final const [ResolvedTo(STATUS)] val FIELD: <implicit> = LAZY_EXPRESSION
public [ResolvedTo(STATUS)] [ContainingClassKey=Some] get(): <implicit>
public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val FIELD: R|kotlin/String| = String()
public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [ContainingClassKey=Some] get(): R|kotlin/String|
}
@@ -249,19 +237,19 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationConflict2.kt
LAZY_super<R|kotlin/Any|>
}
@R|kotlin/annotation/Target|[Types](allowedTargets = vararg(<
@R|kotlin/annotation/Target|[Types](allowedTargets = this@R|/Some|.<
Annotation symbol resolved differently on compiler annotation and symbols stages:
- compiler annotations: FirEnumEntrySymbol kotlin/annotation/AnnotationTarget.FIELD
- compiler arguments stage: null
>#)) public final [ResolvedTo(BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
- compiler arguments stage: FirPropertySymbol /Some.FIELD
>#) public final [ResolvedTo(BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Ann] constructor(): R|Some.Ann| {
super<R|kotlin/Any|>()
}
}
public final const [ResolvedTo(STATUS)] val FIELD: <implicit> = LAZY_EXPRESSION
public [ResolvedTo(STATUS)] [ContainingClassKey=Some] get(): <implicit>
public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val FIELD: R|kotlin/String| = String()
public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [ContainingClassKey=Some] get(): R|kotlin/String|
}
@@ -272,11 +260,11 @@ FILE: [ResolvedTo(BODY_RESOLVE)] compilerRequiredAnnotationConflict2.kt
super<R|kotlin/Any|>()
}
@R|kotlin/annotation/Target|[Types](allowedTargets = vararg(<
@R|kotlin/annotation/Target|[Types](allowedTargets = this@R|/Some|.<
Annotation symbol resolved differently on compiler annotation and symbols stages:
- compiler annotations: FirEnumEntrySymbol kotlin/annotation/AnnotationTarget.FIELD
- compiler arguments stage: null
>#)) public final [ResolvedTo(BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
- compiler arguments stage: FirPropertySymbol /Some.FIELD
>#) public final [ResolvedTo(BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Ann] constructor(): R|Some.Ann| {
super<R|kotlin/Any|>()
}