[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)] annotationWithTarget.kt
@Target[Unresolved](LAZY_EXPRESSION) @Anno[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class ResolveMe : R|kotlin/Annotation| {
@Target[Unresolved](LAZY_EXPRESSION) @Anno[Unresolved](LAZY_EXPRESSION) public final? [ResolvedTo(RAW_FIR)] annotation class ResolveMe : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/ResolveMe.value] value: Int): R|ResolveMe| {
LAZY_super<R|kotlin/Any|>
}
@@ -9,7 +9,7 @@ FILE: [ResolvedTo(RAW_FIR)] annotationWithTarget.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] get(): Int
}
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|>
}
@@ -21,7 +21,7 @@ FILE: [ResolvedTo(RAW_FIR)] annotationWithTarget.kt
IMPORTS:
FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
@Target[Unresolved](LAZY_EXPRESSION) @Anno[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class ResolveMe : R|kotlin/Annotation| {
@Target[Unresolved](LAZY_EXPRESSION) @Anno[Unresolved](LAZY_EXPRESSION) public final? [ResolvedTo(RAW_FIR)] annotation class ResolveMe : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/ResolveMe.value] value: Int): R|ResolveMe| {
LAZY_super<R|kotlin/Any|>
}
@@ -30,7 +30,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] get(): Int
}
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|>
}
@@ -42,7 +42,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
COMPILER_REQUIRED_ANNOTATIONS:
FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
@R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|) @Anno[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class ResolveMe : R|kotlin/Annotation| {
@R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|) @Anno[Unresolved](LAZY_EXPRESSION) public final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class ResolveMe : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/ResolveMe.value] value: Int): R|ResolveMe| {
LAZY_super<R|kotlin/Any|>
}
@@ -51,7 +51,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] get(): Int
}
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|>
}
@@ -63,7 +63,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
COMPANION_GENERATION:
FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
@R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|) @Anno[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(COMPANION_GENERATION)] annotation class ResolveMe : R|kotlin/Annotation| {
@R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|) @Anno[Unresolved](LAZY_EXPRESSION) public final? [ResolvedTo(COMPANION_GENERATION)] annotation class ResolveMe : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/ResolveMe.value] value: Int): R|ResolveMe| {
LAZY_super<R|kotlin/Any|>
}
@@ -72,7 +72,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] get(): Int
}
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|>
}
@@ -84,7 +84,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
SUPER_TYPES:
FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
@R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|) @Anno[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(SUPER_TYPES)] annotation class ResolveMe : R|kotlin/Annotation| {
@R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|) @Anno[Unresolved](LAZY_EXPRESSION) public final? [ResolvedTo(SUPER_TYPES)] annotation class ResolveMe : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/ResolveMe.value] value: Int): R|ResolveMe| {
LAZY_super<R|kotlin/Any|>
}
@@ -93,7 +93,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] get(): Int
}
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)] annotationWithTarget.kt
TYPES:
FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
@R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|) @R|Anno|[Types](LAZY_EXPRESSION) public? final? [ResolvedTo(TYPES)] annotation class ResolveMe : R|kotlin/Annotation| {
@R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CLASS|) @R|Anno|[Types](LAZY_EXPRESSION) public final? [ResolvedTo(TYPES)] annotation class ResolveMe : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/ResolveMe.value] value: Int): R|ResolveMe| {
LAZY_super<R|kotlin/Any|>
}
@@ -114,7 +114,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] get(): Int
}
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|>
}
@@ -135,7 +135,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] get(): Int
}
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|>
}
@@ -156,7 +156,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] get(): Int
}
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|>
}
@@ -177,7 +177,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] get(): Int
}
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|>
}
@@ -198,7 +198,7 @@ FILE: [ResolvedTo(IMPORTS)] annotationWithTarget.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=ResolveMe] get(): Int
}
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|>
}