[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)] compilerRequiredAnnotationsOnConstructor.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|>
}
@@ -9,7 +9,7 @@ FILE: [ResolvedTo(RAW_FIR)] compilerRequiredAnnotationsOnConstructor.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(RAW_FIR)] class A : R|kotlin/Any| {
public final? [ResolvedTo(RAW_FIR)] class A : R|kotlin/Any| {
@Deprecated[Unresolved](LAZY_EXPRESSION) @Anno[Unresolved](LAZY_EXPRESSION) public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=A] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/A.i] @CONSTRUCTOR_PARAMETER:Deprecated[Unresolved](LAZY_EXPRESSION) @CONSTRUCTOR_PARAMETER:Anno[Unresolved](LAZY_EXPRESSION) i: Int, [ResolvedTo(RAW_FIR)] @Deprecated[Unresolved](LAZY_EXPRESSION) @Anno[Unresolved](LAZY_EXPRESSION) b: String): R|A| {
LAZY_super<R|kotlin/Any|>
}
@@ -21,7 +21,7 @@ FILE: [ResolvedTo(RAW_FIR)] compilerRequiredAnnotationsOnConstructor.kt
IMPORTS:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.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)] compilerRequiredAnnotationsOnConstructor.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(RAW_FIR)] class A : R|kotlin/Any| {
public final? [ResolvedTo(RAW_FIR)] class A : R|kotlin/Any| {
@Deprecated[Unresolved](LAZY_EXPRESSION) @Anno[Unresolved](LAZY_EXPRESSION) public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=A] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/A.i] @CONSTRUCTOR_PARAMETER:Deprecated[Unresolved](LAZY_EXPRESSION) @CONSTRUCTOR_PARAMETER:Anno[Unresolved](LAZY_EXPRESSION) i: Int, [ResolvedTo(RAW_FIR)] @Deprecated[Unresolved](LAZY_EXPRESSION) @Anno[Unresolved](LAZY_EXPRESSION) b: String): R|A| {
LAZY_super<R|kotlin/Any|>
}
@@ -42,7 +42,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.kt
COMPILER_REQUIRED_ANNOTATIONS:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.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|>
}
@@ -51,7 +51,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] class A : R|kotlin/Any| {
public final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] class A : R|kotlin/Any| {
@R|kotlin/Deprecated|[CompilerRequiredAnnotations](String(constructor)) @Anno[Unresolved](LAZY_EXPRESSION) public? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] [ContainingClassKey=A] constructor([ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] [CorrespondingProperty=/A.i] @CONSTRUCTOR_PARAMETER:R|kotlin/Deprecated|[CompilerRequiredAnnotations](String(param)) @CONSTRUCTOR_PARAMETER:Anno[Unresolved](LAZY_EXPRESSION) i: Int, [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] @R|kotlin/Deprecated|[CompilerRequiredAnnotations](String(parameter)) @Anno[Unresolved](LAZY_EXPRESSION) b: String): R|A| {
LAZY_super<R|kotlin/Any|>
}
@@ -63,7 +63,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.kt
COMPANION_GENERATION:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.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|>
}
@@ -72,7 +72,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(COMPANION_GENERATION)] class A : R|kotlin/Any| {
public final? [ResolvedTo(COMPANION_GENERATION)] class A : R|kotlin/Any| {
@R|kotlin/Deprecated|[CompilerRequiredAnnotations](String(constructor)) @Anno[Unresolved](LAZY_EXPRESSION) public? [ResolvedTo(COMPANION_GENERATION)] [ContainingClassKey=A] constructor([ResolvedTo(COMPANION_GENERATION)] [CorrespondingProperty=/A.i] @CONSTRUCTOR_PARAMETER:R|kotlin/Deprecated|[CompilerRequiredAnnotations](String(param)) @CONSTRUCTOR_PARAMETER:Anno[Unresolved](LAZY_EXPRESSION) i: Int, [ResolvedTo(COMPANION_GENERATION)] @R|kotlin/Deprecated|[CompilerRequiredAnnotations](String(parameter)) @Anno[Unresolved](LAZY_EXPRESSION) b: String): R|A| {
LAZY_super<R|kotlin/Any|>
}
@@ -84,7 +84,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.kt
SUPER_TYPES:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.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|>
}
@@ -93,7 +93,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(SUPER_TYPES)] class A : R|kotlin/Any| {
public final? [ResolvedTo(SUPER_TYPES)] class A : R|kotlin/Any| {
@R|kotlin/Deprecated|[CompilerRequiredAnnotations](String(constructor)) @Anno[Unresolved](LAZY_EXPRESSION) public? [ResolvedTo(SUPER_TYPES)] [ContainingClassKey=A] constructor([ResolvedTo(SUPER_TYPES)] [CorrespondingProperty=/A.i] @CONSTRUCTOR_PARAMETER:R|kotlin/Deprecated|[CompilerRequiredAnnotations](String(param)) @CONSTRUCTOR_PARAMETER:Anno[Unresolved](LAZY_EXPRESSION) i: Int, [ResolvedTo(SUPER_TYPES)] @R|kotlin/Deprecated|[CompilerRequiredAnnotations](String(parameter)) @Anno[Unresolved](LAZY_EXPRESSION) b: String): R|A| {
LAZY_super<R|kotlin/Any|>
}
@@ -105,7 +105,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.kt
TYPES:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.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|>
}
@@ -114,7 +114,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.kt
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String
}
public? final? [ResolvedTo(TYPES)] class A : R|kotlin/Any| {
public final? [ResolvedTo(TYPES)] class A : R|kotlin/Any| {
@R|kotlin/Deprecated|[Types](String(constructor)) @R|Anno|[Types](LAZY_EXPRESSION) public? [ResolvedTo(TYPES)] [ContainingClassKey=A] constructor([ResolvedTo(TYPES)] [CorrespondingProperty=/A.i] @CONSTRUCTOR_PARAMETER:R|kotlin/Deprecated|[Types](String(param)) @CONSTRUCTOR_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) i: R|kotlin/Int|, [ResolvedTo(TYPES)] @R|kotlin/Deprecated|[Types](String(parameter)) @R|Anno|[Types](LAZY_EXPRESSION) b: R|kotlin/String|): R|A| {
LAZY_super<R|kotlin/Any|>
}
@@ -126,7 +126,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.kt
STATUS:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.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|>
}
@@ -147,7 +147,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.kt
EXPECT_ACTUAL_MATCHING:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.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|>
}
@@ -168,7 +168,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.kt
CONTRACTS:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.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|>
}
@@ -189,7 +189,7 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.kt
IMPLICIT_TYPES_BODY_RESOLVE:
FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnConstructor.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|>
}