Files
Ivan Kochurkin 69b9bfc3e0 [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
2024-01-04 16:17:32 +00:00

51 lines
1.8 KiB
Plaintext
Vendored

Tower Data Context:
Element 0
Scope: FirDefaultStarImportingScope
Element 1
Scope: FirExplicitStarImportingScope
Element 2
Scope: FirDefaultSimpleImportingScope
Element 3
Scope: FirDefaultSimpleImportingScope
Element 4
Scope: FirPackageMemberScope
Element 5
Scope: FirExplicitSimpleImportingScope
Element 6
Implicit receiver:
FirRegularClassSymbol public final class Foo : R|kotlin/Any|
Type: foo.Foo
Element 7
Scope: FirLocalScope
Properties:
FirValueParameterSymbol p: R|kotlin/String|
Element 8
Scope: FirLocalScope
Properties:
FirPropertySymbol lval x: R|kotlin/Float|
FILE: [ResolvedTo(IMPORTS)] simple.kt
public final [ResolvedTo(STATUS)] class Foo : R|kotlin/Any| {
public [ResolvedTo(STATUS)] constructor(): R|foo/Foo| {
LAZY_super<R|kotlin/Any|>
}
public final [ResolvedTo(STATUS)] val a: R|kotlin/Int|
public [ResolvedTo(STATUS)] get(): R|kotlin/Int|
public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] p: R|kotlin/String|): R|kotlin/Unit| {
[ResolvedTo(BODY_RESOLVE)] lval x: R|kotlin/Float| = Float(1.0)
<Unresolved name: print>#(R|<local>/x|)
}
}
public final? [ResolvedTo(RAW_FIR)] class Unrelated : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] constructor(): R|foo/Unrelated| {
LAZY_super<R|kotlin/Any|>
}
public? final? [ResolvedTo(RAW_FIR)] val unrelatedMember: Boolean
public? [ResolvedTo(RAW_FIR)] get(): Boolean { LAZY_BLOCK }
}
public? final? [ResolvedTo(RAW_FIR)] fun unrelatedFunction(): Int { LAZY_BLOCK }