[FIR] Initialize public visibility for class-like declarations at FIR building phase if no modifier is presented

Java resolving subsystem requires calculated visibility for correct disambiguation of supertypes.
But visibility remains `Unknown` for Kotlin class-like declarations during supertypes resolving because `STATUS` resolve phase is performed after `SUPER_TYPES` phase.
To fix the problem, the visibility should be initialized to public at the FIR building phase if no modifier is presented.

^KT-64127 Fixed
This commit is contained in:
Ivan Kochurkin
2023-12-13 23:57:19 +01:00
committed by Space Team
parent ee8d42532b
commit 69b9bfc3e0
915 changed files with 12362 additions and 12164 deletions
@@ -1,6 +1,6 @@
RAW_FIR:
FILE: [ResolvedTo(RAW_FIR)] compilerRequiredAnnotationsOnProperty.kt
public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
@@ -15,7 +15,7 @@ FILE: [ResolvedTo(RAW_FIR)] compilerRequiredAnnotationsOnProperty.kt
IMPORTS:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
@@ -30,7 +30,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
COMPILER_REQUIRED_ANNOTATIONS:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
@@ -45,7 +45,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
COMPANION_GENERATION:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
@@ -60,7 +60,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
SUPER_TYPES:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
@@ -75,7 +75,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
TYPES:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
@@ -90,7 +90,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
STATUS:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
@@ -105,7 +105,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
EXPECT_ACTUAL_MATCHING:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
@@ -120,7 +120,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
CONTRACTS:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}
@@ -139,7 +139,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
IMPLICIT_TYPES_BODY_RESOLVE:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt
public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| {
LAZY_super<R|kotlin/Any|>
}