[FIR] Refactor effective visibility calculation
Before this commit, we had effective visibility as a part of FIR status, so it was integrated into the full pipeline. In this commit, we introduced "effective visibility as a service" which is now used only by exposed visibility checker. This allows us to make the thing universal for all FIR nodes, including nodes for Java / deserialized.
This commit is contained in:
@@ -259,3 +259,4 @@ public final class LongRange : R|kotlin/ranges/LongProgression|, R|kotlin/ranges
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Vendored
+6
-6
@@ -1,11 +1,11 @@
|
||||
FILE: RedundantVisibilityModifierChecker.kt
|
||||
public final fun f(): R|kotlin/Unit| {
|
||||
local final class LocalClass : R|kotlin/Any| {
|
||||
public[local] constructor(): R|LocalClass| {
|
||||
public constructor(): R|LocalClass| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
internal[local] final var foo: R|kotlin/Int| = Int(0)
|
||||
internal final var foo: R|kotlin/Int| = Int(0)
|
||||
internal get(): R|kotlin/Int|
|
||||
internal set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
@@ -23,11 +23,11 @@ FILE: RedundantVisibilityModifierChecker.kt
|
||||
}
|
||||
|
||||
internal final val z: R|<anonymous>| = object : R|kotlin/Any| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(): R|kotlin/Int| {
|
||||
public final fun foo(): R|kotlin/Int| {
|
||||
^foo Int(13)
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ FILE: RedundantVisibilityModifierChecker.kt
|
||||
}
|
||||
|
||||
internal final inner class B<T, T2, T1, T2 : R|T1|> : R|kotlin/Any| {
|
||||
public[internal] constructor<T, T2>(): R|Foo2.B<T, T2, T1, T2>| {
|
||||
public constructor<T, T2>(): R|Foo2.B<T, T2, T1, T2>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ FILE: RedundantVisibilityModifierChecker.kt
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
public final static enum entry FIRST: R|F| = object : R|F| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|F|>(Int(42))
|
||||
}
|
||||
|
||||
|
||||
compiler/fir/analysis-tests/testData/loadCompiledKotlin/classObject/ClassObjectDefaultVisibility.txt
Vendored
+1
@@ -72,3 +72,4 @@ public final class Pub : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -87,3 +87,4 @@ public final class PubPub : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -2,3 +2,4 @@ internal final class InternalClass : R|kotlin/Any| {
|
||||
public constructor(): R|test/InternalClass|
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -2,3 +2,4 @@ private final class PrivateClass : R|kotlin/Any| {
|
||||
public constructor(): R|test/PrivateClass|
|
||||
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -4,18 +4,18 @@ FILE: companionInvoke.kt
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[internal] final val name: R|kotlin/String| = R|<local>/name|
|
||||
public final val name: R|kotlin/String| = R|<local>/name|
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
public[internal] final val signature: R|T| = R|<local>/signature|
|
||||
public final val signature: R|T| = R|<local>/signature|
|
||||
public get(): R|T|
|
||||
|
||||
public[internal] final companion object Companion : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
private constructor(): R|Method.Companion| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[internal] final operator fun invoke(name: R|kotlin/String|): R|Method<kotlin/String?>| {
|
||||
public final operator fun invoke(name: R|kotlin/String|): R|Method<kotlin/String?>| {
|
||||
^invoke R|kotlin/TODO|()
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ FILE: annotatedLocalClass.kt
|
||||
}
|
||||
|
||||
@R|Ann|() local final class Local : R|kotlin/Any| {
|
||||
public[local] constructor(): R|Local| {
|
||||
public constructor(): R|Local| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
FILE: innerClassInAnonymousObject.kt
|
||||
public final val x: R|<anonymous>| = object : R|kotlin/Any| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
local final class Nested : R|kotlin/Any| {
|
||||
public[local] constructor(): R|<anonymous>.Nested| {
|
||||
public constructor(): R|<anonymous>.Nested| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(): R|kotlin/Unit| {
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+8
-8
@@ -10,11 +10,11 @@ FILE: localClassesWithImplicit.kt
|
||||
}
|
||||
|
||||
local final class A : R|kotlin/Any| {
|
||||
public[local] constructor(): R|A| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(): R|kotlin/Int| {
|
||||
public final fun foo(): R|kotlin/Int| {
|
||||
^foo R|/myRun|<R|kotlin/Int|>(<L> = myRun@fun <anonymous>(): R|kotlin/Int| <kind=UNKNOWN> {
|
||||
R|<local>/a|.R|kotlin/String.length|
|
||||
^ when () {
|
||||
@@ -31,7 +31,7 @@ FILE: localClassesWithImplicit.kt
|
||||
)
|
||||
}
|
||||
|
||||
public[local] final fun bar(): R|kotlin/Int| {
|
||||
public final fun bar(): R|kotlin/Int| {
|
||||
^bar R|/myRun|<R|kotlin/Int|>(<L> = myRun@fun <anonymous>(): R|kotlin/Int| <kind=UNKNOWN> {
|
||||
R|<local>/b|.<Unresolved name: length>#
|
||||
R|<local>/a|.R|kotlin/String.length|
|
||||
@@ -40,18 +40,18 @@ FILE: localClassesWithImplicit.kt
|
||||
)
|
||||
}
|
||||
|
||||
public[local] final fun baz(): R|kotlin/Int| {
|
||||
public final fun baz(): R|kotlin/Int| {
|
||||
^baz Int(1)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
lval x: R|<anonymous>| = object : R|kotlin/Any| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(): R|kotlin/Int| {
|
||||
public final fun foo(): R|kotlin/Int| {
|
||||
^foo R|/myRun|<R|kotlin/Int|>(<L> = myRun@fun <anonymous>(): R|kotlin/Int| <kind=UNKNOWN> {
|
||||
R|<local>/a|.R|kotlin/String.length|
|
||||
^ when () {
|
||||
@@ -68,7 +68,7 @@ FILE: localClassesWithImplicit.kt
|
||||
)
|
||||
}
|
||||
|
||||
public[local] final fun bar(): R|kotlin/Int| {
|
||||
public final fun bar(): R|kotlin/Int| {
|
||||
^bar R|/myRun|<R|kotlin/Int|>(<L> = myRun@fun <anonymous>(): R|kotlin/Int| <kind=UNKNOWN> {
|
||||
R|<local>/a|.R|kotlin/String.length|
|
||||
R|<local>/b|.<Unresolved name: length>#
|
||||
@@ -77,7 +77,7 @@ FILE: localClassesWithImplicit.kt
|
||||
)
|
||||
}
|
||||
|
||||
public[local] final fun baz(): R|kotlin/Int| {
|
||||
public final fun baz(): R|kotlin/Int| {
|
||||
^baz Int(1)
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ FILE: propertiesAndInitBlocks.kt
|
||||
}
|
||||
|
||||
local final class InitializerLocalClass : R|kotlin/Any| {
|
||||
public[local] constructor(): R|InitializerLocalClass| {
|
||||
public constructor(): R|InitializerLocalClass| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ FILE: propertiesAndInitBlocks.kt
|
||||
)
|
||||
public get(): R|kotlin/Unit| {
|
||||
local final class GetterLocalClass : R|kotlin/Any| {
|
||||
public[local] constructor(): R|GetterLocalClass| {
|
||||
public constructor(): R|GetterLocalClass| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@ FILE: anonymousObjectByDelegate.kt
|
||||
object : R|B| {
|
||||
local final field <$$delegate_0>: R|B|
|
||||
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
this@R|/<anonymous>|.R|<local>/<$$delegate_0>| = this@R|/test_1|.R|/A.b|
|
||||
}
|
||||
@@ -23,7 +23,7 @@ FILE: anonymousObjectByDelegate.kt
|
||||
object : R|B| {
|
||||
local final field <$$delegate_0>: R|B|
|
||||
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
this@R|/<anonymous>|.R|<local>/<$$delegate_0>| = this@R|/test_2|.R|/A.b|
|
||||
}
|
||||
|
||||
+4
-4
@@ -6,13 +6,13 @@ FILE: incompatibleModifiers.kt
|
||||
|
||||
}
|
||||
private final class B : R|kotlin/Any| {
|
||||
public[private] constructor(): R|B| {
|
||||
public constructor(): R|B| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
protected final class C : R|kotlin/Any| {
|
||||
public[protected] constructor(): R|C| {
|
||||
public constructor(): R|C| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
@@ -95,13 +95,13 @@ FILE: incompatibleModifiers.kt
|
||||
|
||||
}
|
||||
private open class L : R|K| {
|
||||
public[private] constructor(): R|L| {
|
||||
public constructor(): R|L| {
|
||||
super<R|K|>()
|
||||
}
|
||||
|
||||
}
|
||||
private abstract class M : R|K| {
|
||||
public[private] constructor(): R|M| {
|
||||
public constructor(): R|M| {
|
||||
super<R|K|>()
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -1,19 +1,19 @@
|
||||
FILE: localAnnotationClass.kt
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
local final annotation class Ann : R|kotlin/Annotation| {
|
||||
public[local] constructor(): R|Ann| {
|
||||
public constructor(): R|Ann| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@R|ERROR CLASS: Symbol not found, for `Anno`|() local final class Local : R|kotlin/Any| {
|
||||
public[local] constructor(): R|Local| {
|
||||
public constructor(): R|Local| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
local final annotation class Nested : R|kotlin/Annotation| {
|
||||
public[local] constructor(): R|Local.Nested| {
|
||||
public constructor(): R|Local.Nested| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
|
||||
+9
-9
@@ -22,22 +22,22 @@ FILE: enum.kt
|
||||
public get(): R|Some|
|
||||
|
||||
public final static enum entry FIRST: R|SomeEnum| = object : R|SomeEnum| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|SomeEnum|>(Q|O1|)
|
||||
}
|
||||
|
||||
public[local] final override fun check(y: R|Some|): R|kotlin/Boolean| {
|
||||
public final override fun check(y: R|Some|): R|kotlin/Boolean| {
|
||||
^check Boolean(true)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final static enum entry SECOND: R|SomeEnum| = object : R|SomeEnum| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|SomeEnum|>(Q|O2|)
|
||||
}
|
||||
|
||||
public[local] final override fun check(y: R|Some|): R|kotlin/Boolean| {
|
||||
public final override fun check(y: R|Some|): R|kotlin/Boolean| {
|
||||
^check ==(R|<local>/y|, Q|O2|)
|
||||
}
|
||||
|
||||
@@ -71,28 +71,28 @@ FILE: enum.kt
|
||||
}
|
||||
|
||||
public final static enum entry E1: R|EnumClass| = object : R|EnumClass| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|EnumClass|>()
|
||||
}
|
||||
|
||||
public[local] final override fun foo(): R|kotlin/Int| {
|
||||
public final override fun foo(): R|kotlin/Int| {
|
||||
^foo Int(1)
|
||||
}
|
||||
|
||||
public[local] final override val bar: R|kotlin/String| = String(a)
|
||||
public final override val bar: R|kotlin/String| = String(a)
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
}
|
||||
|
||||
public final static enum entry E2: R|EnumClass| = object : R|EnumClass| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|EnumClass|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final static enum entry E3: R|EnumClass| = object : R|EnumClass| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|EnumClass|>()
|
||||
}
|
||||
|
||||
|
||||
Vendored
+4
-4
@@ -30,16 +30,16 @@ FILE: CallBasedInExpressionGenerator.kt
|
||||
|
||||
private final fun gen(argument: R|ERROR CLASS: Symbol not found, for `StackValue`|): R|ERROR CLASS: Symbol not found, for `BranchedValue`| {
|
||||
^gen object : R|ERROR CLASS: Symbol not found, for `BranchedValue`| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|ERROR CLASS: Symbol not found, for `BranchedValue`|>(R|<local>/argument|, Null(null), R|<local>/argument|.<Unresolved name: type>#, <Unresolved name: Opcodes>#.<Unresolved name: IFEQ>#)
|
||||
}
|
||||
|
||||
public[local] final override fun putSelector(type: R|ERROR CLASS: Symbol not found, for `Type`|, kotlinType: R|ERROR CLASS: Symbol not found, for `KotlinType?`|, v: R|ERROR CLASS: Symbol not found, for `InstructionAdapter`|): R|kotlin/Unit| {
|
||||
public final override fun putSelector(type: R|ERROR CLASS: Symbol not found, for `Type`|, kotlinType: R|ERROR CLASS: Symbol not found, for `KotlinType?`|, v: R|ERROR CLASS: Symbol not found, for `InstructionAdapter`|): R|kotlin/Unit| {
|
||||
this@R|/<anonymous>|.R|/<anonymous>.invokeFunction|(R|<local>/v|)
|
||||
<Unresolved name: coerceTo>#(R|<local>/type|, R|<local>/kotlinType|, R|<local>/v|)
|
||||
}
|
||||
|
||||
public[local] final override fun condJump(jumpLabel: R|ERROR CLASS: Symbol not found, for `Label`|, v: R|ERROR CLASS: Symbol not found, for `InstructionAdapter`|, jumpIfFalse: R|kotlin/Boolean|): R|kotlin/Unit| {
|
||||
public final override fun condJump(jumpLabel: R|ERROR CLASS: Symbol not found, for `Label`|, v: R|ERROR CLASS: Symbol not found, for `InstructionAdapter`|, jumpIfFalse: R|kotlin/Boolean|): R|kotlin/Unit| {
|
||||
this@R|/<anonymous>|.R|/<anonymous>.invokeFunction|(R|<local>/v|)
|
||||
R|<local>/v|.<Unresolved name: visitJumpInsn>#(when () {
|
||||
R|<local>/jumpIfFalse| -> {
|
||||
@@ -52,7 +52,7 @@ FILE: CallBasedInExpressionGenerator.kt
|
||||
, R|<local>/jumpLabel|)
|
||||
}
|
||||
|
||||
private[local] final fun invokeFunction(v: R|ERROR CLASS: Symbol not found, for `InstructionAdapter`|): R|kotlin/Unit| {
|
||||
private final fun invokeFunction(v: R|ERROR CLASS: Symbol not found, for `InstructionAdapter`|): R|kotlin/Unit| {
|
||||
lval result: <ERROR TYPE REF: Unresolved name: invokeFunction> = this@R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator|.R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.codegen|.<Unresolved name: invokeFunction>#(this@R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator|.R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.resolvedCall|.<Unresolved name: call>#, this@R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator|.R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.resolvedCall|, <Unresolved name: none>#())
|
||||
R|<local>/result|.<Unresolved name: put>#(R|<local>/result|.<Unresolved name: type>#, R|<local>/result|.<Unresolved name: kotlinType>#, R|<local>/v|)
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ FILE: enumEntryUse.kt
|
||||
public final static enum entry FIRST: R|TestEnum|
|
||||
public final static enum entry SECOND: R|TestEnum|
|
||||
public final static enum entry THIRD: R|TestEnum| = object : R|TestEnum| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|TestEnum|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(): R|kotlin/Unit| {
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -6,11 +6,11 @@ FILE: localClassAccessesContainingClass.kt
|
||||
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
local final class Local : R|kotlin/Any| {
|
||||
public[local] constructor(): R|Outer.Local| {
|
||||
public constructor(): R|Outer.Local| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun bar(): R|kotlin/Unit| {
|
||||
public final fun bar(): R|kotlin/Unit| {
|
||||
lval x: R|kotlin/String| = this@R|/Outer|.R|/Outer.y|
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
FILE: localConstructor.kt
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
local final class Local : R|kotlin/Any| {
|
||||
public[local] constructor(): R|Local| {
|
||||
public constructor(): R|Local| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
FILE: localImplicitBodies.kt
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
lval x: R|<anonymous>| = object : R|kotlin/Any| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun sss(): R|kotlin/Int| {
|
||||
public final fun sss(): R|kotlin/Int| {
|
||||
^sss this@R|/<anonymous>|.R|/<anonymous>.abc|()
|
||||
}
|
||||
|
||||
public[local] final fun abc(): R|kotlin/Int| {
|
||||
public final fun abc(): R|kotlin/Int| {
|
||||
^abc Int(1)
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -3,20 +3,20 @@ FILE: localInnerClass.kt
|
||||
}
|
||||
public final fun bar(): R|kotlin/Unit| {
|
||||
object : R|Foo| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(): R|Foo| {
|
||||
public final fun foo(): R|Foo| {
|
||||
^foo this@R|/<anonymous>|.R|/<anonymous>.Derived.Derived|(Int(42))
|
||||
}
|
||||
|
||||
local final inner class Derived : R|Foo| {
|
||||
public[local] constructor(x: R|kotlin/Int|): R|<anonymous>.Derived| {
|
||||
public constructor(x: R|kotlin/Int|): R|<anonymous>.Derived| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final val x: R|kotlin/Int| = R|<local>/x|
|
||||
public final val x: R|kotlin/Int| = R|<local>/x|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ FILE: localObjects.kt
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
Q|A|.R|/A.x|
|
||||
lval b: R|<anonymous>| = object : R|Foo| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|Foo|>()
|
||||
}
|
||||
|
||||
@@ -29,11 +29,11 @@ FILE: localObjects.kt
|
||||
|
||||
R|<local>/b|.R|/Foo.foo|()
|
||||
local final object B : R|kotlin/Any| {
|
||||
private[local] constructor(): R|B| {
|
||||
private constructor(): R|B| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(): R|kotlin/Unit| {
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ FILE: localScopes.kt
|
||||
}
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
local open class BaseLocal : R|Bar| {
|
||||
public[local] constructor(): R|BaseLocal| {
|
||||
public constructor(): R|BaseLocal| {
|
||||
super<R|Bar|>()
|
||||
}
|
||||
|
||||
public[local] final fun baz(): R|kotlin/Unit| {
|
||||
public final fun baz(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,11 +23,11 @@ FILE: localScopes.kt
|
||||
R|<local>/base|.R|/BaseLocal.baz|()
|
||||
R|<local>/base|.R|/Bar.foo|()
|
||||
lval anonymous: R|<anonymous>| = object : R|Bar| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|Bar|>()
|
||||
}
|
||||
|
||||
public[local] final fun baz(): R|kotlin/Unit| {
|
||||
public final fun baz(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -35,11 +35,11 @@ FILE: localScopes.kt
|
||||
R|<local>/anonymous|.R|/<anonymous>.baz|()
|
||||
R|<local>/anonymous|.R|/Bar.foo|()
|
||||
local final class DerivedLocal : R|BaseLocal| {
|
||||
public[local] constructor(): R|DerivedLocal| {
|
||||
public constructor(): R|DerivedLocal| {
|
||||
super<R|BaseLocal|>()
|
||||
}
|
||||
|
||||
public[local] final fun gau(): R|kotlin/Unit| {
|
||||
public final fun gau(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,24 +4,24 @@ FILE: localTypes.kt
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
lval x: R|kotlin/Int| = Int(1)
|
||||
local final class Bar : R|Foo| {
|
||||
public[local] constructor(): R|Bar| {
|
||||
public constructor(): R|Bar| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final val y: R|kotlin/String| = String()
|
||||
public final val y: R|kotlin/String| = String()
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
public[local] final fun R|kotlin/Int|.bar(s: R|kotlin/String|): R|kotlin/Boolean| {
|
||||
public final fun R|kotlin/Int|.bar(s: R|kotlin/String|): R|kotlin/Boolean| {
|
||||
lval z: R|kotlin/Double| = Double(0.0)
|
||||
^bar Boolean(true)
|
||||
}
|
||||
|
||||
public[local] final val R|kotlin/Boolean|.w: R|kotlin/Char|
|
||||
public final val R|kotlin/Boolean|.w: R|kotlin/Char|
|
||||
public get(): R|kotlin/Char| {
|
||||
^ Char( )
|
||||
}
|
||||
|
||||
public[local] final fun <T : R|Foo|> id(arg: R|T|): R|T| {
|
||||
public final fun <T : R|Foo|> id(arg: R|T|): R|T| {
|
||||
^id R|<local>/arg|
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -1,19 +1,19 @@
|
||||
FILE: foo.kt
|
||||
public final fun foo(): R|kotlin/Boolean| {
|
||||
object : R|Node<kotlin/Boolean>| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
private[local] final var result: R|kotlin/Boolean| = Boolean(false)
|
||||
private final var result: R|kotlin/Boolean| = Boolean(false)
|
||||
private get(): R|kotlin/Boolean|
|
||||
private set(value: R|kotlin/Boolean|): R|kotlin/Unit|
|
||||
|
||||
public[local] final fun bar(): R|kotlin/Boolean| {
|
||||
public final fun bar(): R|kotlin/Boolean| {
|
||||
^bar this@R|/<anonymous>|.R|/<anonymous>.result|.R|kotlin/Boolean.not|()
|
||||
}
|
||||
|
||||
public[local] final override fun result(): R|kotlin/Boolean| {
|
||||
public final override fun result(): R|kotlin/Boolean| {
|
||||
^result this@R|/<anonymous>|.R|/<anonymous>.result|
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -5,28 +5,28 @@ FILE: nestedVisibility.kt
|
||||
}
|
||||
|
||||
private final class PrivateNested : R|kotlin/Any| {
|
||||
public[private] constructor(): R|Outer.PrivateNested| {
|
||||
public constructor(): R|Outer.PrivateNested| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private final inner class PrivateInner : R|kotlin/Any| {
|
||||
public[private] constructor(): R|Outer.PrivateInner| {
|
||||
public constructor(): R|Outer.PrivateInner| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected final class ProtectedNested : R|kotlin/Any| {
|
||||
public[protected] constructor(): R|Outer.ProtectedNested| {
|
||||
public constructor(): R|Outer.ProtectedNested| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected final inner class ProtectedInner : R|kotlin/Any| {
|
||||
public[protected] constructor(): R|Outer.ProtectedInner| {
|
||||
public constructor(): R|Outer.ProtectedInner| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
|
||||
+14
-14
@@ -14,7 +14,7 @@ FILE: O.kt
|
||||
}
|
||||
|
||||
private final class Derived : R|Base| {
|
||||
public[private] constructor(bar: R|kotlin/Int|): R|O.Derived| {
|
||||
public constructor(bar: R|kotlin/Int|): R|O.Derived| {
|
||||
super<R|Base|>()
|
||||
}
|
||||
|
||||
@@ -22,30 +22,30 @@ FILE: O.kt
|
||||
private get(): R|kotlin/Int|
|
||||
|
||||
private final inner class Some : R|kotlin/Any| {
|
||||
public[private] constructor(z: R|kotlin/Boolean|): R|O.Derived.Some| {
|
||||
public constructor(z: R|kotlin/Boolean|): R|O.Derived.Some| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[private] final val z: R|kotlin/Boolean| = R|<local>/z|
|
||||
public final val z: R|kotlin/Boolean| = R|<local>/z|
|
||||
public get(): R|kotlin/Boolean|
|
||||
|
||||
public[private] final fun test(): R|kotlin/Unit| {
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
lval x: R|kotlin/Int| = this@R|/O.Derived|.R|/O.Derived.bar|
|
||||
lval o: R|<anonymous>| = object : R|Wrapper| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|Wrapper|>(this@R|/O.Derived.Some|.R|/O.Derived.Some.z|)
|
||||
}
|
||||
|
||||
public[local] final fun local(): R|kotlin/Unit| {
|
||||
public final fun local(): R|kotlin/Unit| {
|
||||
lval y: R|ft<kotlin/String, kotlin/String?>!| = this@R|/O.Derived|.R|/Base.foo|()
|
||||
}
|
||||
|
||||
public[local] final val oo: R|<anonymous>| = object : R|kotlin/Any| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
public final val oo: R|<anonymous>| = object : R|kotlin/Any| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final val zz: R|kotlin/Boolean| = this@R|/O.Derived.Some|.R|/O.Derived.Some.z|
|
||||
public final val zz: R|kotlin/Boolean| = this@R|/O.Derived.Some|.R|/O.Derived.Some.z|
|
||||
public get(): R|kotlin/Boolean|
|
||||
|
||||
}
|
||||
@@ -58,14 +58,14 @@ FILE: O.kt
|
||||
|
||||
}
|
||||
|
||||
public[private] final fun test(): R|kotlin/Unit| {
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
lval x: R|kotlin/Int| = this@R|/O.Derived|.R|/O.Derived.bar|
|
||||
lval o: R|<anonymous>| = object : R|kotlin/Any| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun local(): R|kotlin/Unit| {
|
||||
public final fun local(): R|kotlin/Unit| {
|
||||
lval y: R|ft<kotlin/String, kotlin/String?>!| = this@R|/O.Derived|.R|/Base.foo|()
|
||||
}
|
||||
|
||||
@@ -86,11 +86,11 @@ FILE: O.kt
|
||||
|
||||
private final fun gen(): R|kotlin/Any| {
|
||||
^gen object : R|Wrapper| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|Wrapper|>(Boolean(true))
|
||||
}
|
||||
|
||||
private[local] final fun invokeFunction(): R|kotlin/Unit| {
|
||||
private final fun invokeFunction(): R|kotlin/Unit| {
|
||||
lval c: R|kotlin/Any| = this@R|/Generator|.R|/Generator.codegen|
|
||||
lval cc: R|kotlin/Int| = this@R|/Generator|.R|/Generator.codegen|.R|kotlin/Any.hashCode|()
|
||||
}
|
||||
|
||||
+4
-4
@@ -5,11 +5,11 @@ FILE: privateObjectLiteral.kt
|
||||
}
|
||||
|
||||
private final val x: R|<anonymous>| = object : R|kotlin/Any| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(): R|kotlin/Int| {
|
||||
public final fun foo(): R|kotlin/Int| {
|
||||
^foo Int(42)
|
||||
}
|
||||
|
||||
@@ -21,11 +21,11 @@ FILE: privateObjectLiteral.kt
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
internal final val z: R|<anonymous>| = object : R|kotlin/Any| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(): R|kotlin/Int| {
|
||||
public final fun foo(): R|kotlin/Int| {
|
||||
^foo Int(13)
|
||||
}
|
||||
|
||||
|
||||
+14
-14
@@ -2,26 +2,26 @@ FILE: first.kt
|
||||
private final fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
private final class Private : R|kotlin/Any| {
|
||||
public[private] constructor(): R|Private| {
|
||||
public constructor(): R|Private| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
private final fun bar(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public[private] final fun baz(): R|kotlin/Unit| {
|
||||
public final fun baz(): R|kotlin/Unit| {
|
||||
this@R|/Private|.R|/Private.bar|()
|
||||
R|/Private.Nested.Nested|()
|
||||
this@R|/Private.Companion|.R|/Private.Companion.fromCompanion|()
|
||||
Q|Private.NotCompanion|.<HIDDEN: /Private.NotCompanion.foo is invisible>#()
|
||||
}
|
||||
|
||||
public[private] final inner class Inner : R|kotlin/Any| {
|
||||
public[private] constructor(): R|Private.Inner| {
|
||||
public final inner class Inner : R|kotlin/Any| {
|
||||
public constructor(): R|Private.Inner| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[private] final fun foo(): R|kotlin/Unit| {
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
this@R|/Private|.R|/Private.bar|()
|
||||
this@R|/Private.Companion|.R|/Private.Companion.fromCompanion|()
|
||||
Q|Private.NotCompanion|.<HIDDEN: /Private.NotCompanion.foo is invisible>#()
|
||||
@@ -30,18 +30,18 @@ FILE: first.kt
|
||||
}
|
||||
|
||||
private final class Nested : R|kotlin/Any| {
|
||||
public[private] constructor(): R|Private.Nested| {
|
||||
public constructor(): R|Private.Nested| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[private] final fun foo(): R|kotlin/Unit| {
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
this@R|/Private.Companion|.R|/Private.Companion.fromCompanion|()
|
||||
Q|Private.NotCompanion|.<HIDDEN: /Private.NotCompanion.foo is invisible>#()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public[private] final companion object Companion : R|kotlin/Any| {
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
private constructor(): R|Private.Companion| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
@@ -51,7 +51,7 @@ FILE: first.kt
|
||||
|
||||
}
|
||||
|
||||
public[private] final object NotCompanion : R|kotlin/Any| {
|
||||
public final object NotCompanion : R|kotlin/Any| {
|
||||
private constructor(): R|Private.NotCompanion| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
@@ -64,23 +64,23 @@ FILE: first.kt
|
||||
}
|
||||
public final fun withLocals(): R|kotlin/Unit| {
|
||||
local final class Local : R|kotlin/Any| {
|
||||
public[local] constructor(): R|Local| {
|
||||
public constructor(): R|Local| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
private[local] final fun bar(): R|kotlin/Unit|
|
||||
private final fun bar(): R|kotlin/Unit|
|
||||
|
||||
public[local] final fun baz(): R|kotlin/Unit| {
|
||||
public final fun baz(): R|kotlin/Unit| {
|
||||
this@R|/Local|.R|/Local.bar|()
|
||||
this@R|/Local|.R|/Local.Inner.Inner|()
|
||||
}
|
||||
|
||||
local final inner class Inner : R|kotlin/Any| {
|
||||
public[local] constructor(): R|Local.Inner| {
|
||||
public constructor(): R|Local.Inner| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(): R|kotlin/Unit| {
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
this@R|/Local|.R|/Local.bar|()
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -24,11 +24,11 @@ FILE: protectedVisibility.kt
|
||||
}
|
||||
|
||||
protected open class Nested : R|kotlin/Any| {
|
||||
public[protected] constructor(): R|Protected.Nested| {
|
||||
public constructor(): R|Protected.Nested| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[protected] final fun foo(): R|kotlin/Unit| {
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
this@R|/Protected.Nested|.R|/Protected.Nested.bar|()
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ FILE: protectedVisibility.kt
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[protected] final fun fromCompanion(): R|kotlin/Unit| {
|
||||
public final fun fromCompanion(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
protected final fun protectedFromCompanion(): R|kotlin/Unit| {
|
||||
@@ -65,11 +65,11 @@ FILE: protectedVisibility.kt
|
||||
}
|
||||
|
||||
private final class NestedDerived : R|Protected.Nested| {
|
||||
public[private] constructor(): R|Derived.NestedDerived| {
|
||||
public constructor(): R|Derived.NestedDerived| {
|
||||
super<R|Protected.Nested|>()
|
||||
}
|
||||
|
||||
public[private] final fun use(): R|kotlin/Unit| {
|
||||
public final fun use(): R|kotlin/Unit| {
|
||||
this@R|/Derived.NestedDerived|.R|/Protected.Nested.bar|()
|
||||
}
|
||||
|
||||
|
||||
@@ -26,33 +26,33 @@ FILE: enums.kt
|
||||
internal get(): R|kotlin/Double|
|
||||
|
||||
public final static enum entry MERCURY: R|Planet| = object : R|Planet| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|Planet|>(Double(1.0), Double(2.0))
|
||||
}
|
||||
|
||||
public[local] final override fun sayHello(): R|kotlin/Unit| {
|
||||
public final override fun sayHello(): R|kotlin/Unit| {
|
||||
<Unresolved name: println>#(String(Hello!!!))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final static enum entry VENERA: R|Planet| = object : R|Planet| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|Planet|>(Double(3.0), Double(4.0))
|
||||
}
|
||||
|
||||
public[local] final override fun sayHello(): R|kotlin/Unit| {
|
||||
public final override fun sayHello(): R|kotlin/Unit| {
|
||||
<Unresolved name: println>#(String(Ola!!!))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final static enum entry EARTH: R|Planet| = object : R|Planet| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|Planet|>(Double(5.0), Double(6.0))
|
||||
}
|
||||
|
||||
public[local] final override fun sayHello(): R|kotlin/Unit| {
|
||||
public final override fun sayHello(): R|kotlin/Unit| {
|
||||
<Unresolved name: println>#(String(Privet!!!))
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -4,11 +4,11 @@ FILE: callableReferenceToLocalClass.kt
|
||||
}
|
||||
public final fun test_1(): R|kotlin/Unit| {
|
||||
local final class Data : R|kotlin/Any| {
|
||||
public[local] constructor(x: R|kotlin/Int|): R|Data| {
|
||||
public constructor(x: R|kotlin/Int|): R|Data| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final val x: R|kotlin/Int| = R|<local>/x|
|
||||
public final val x: R|kotlin/Int| = R|<local>/x|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
|
||||
+5
-5
@@ -1,23 +1,23 @@
|
||||
FILE: implicitInAnonymous.kt
|
||||
private final val x: R|<anonymous>| = object : R|kotlin/Any| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(x: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||
public final fun foo(x: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||
^foo this@R|/<anonymous>|.R|/<anonymous>.bar|(R|<local>/x|)
|
||||
}
|
||||
|
||||
public[local] final fun bar(y: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||
public final fun bar(y: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||
^bar CMP(>, this@R|/<anonymous>|.R|kotlin/Any.hashCode|().R|kotlin/Int.plus|(R|<local>/y|).R|kotlin/Int.compareTo|(Int(0)))
|
||||
}
|
||||
|
||||
public[local] final val w: R|kotlin/Boolean|
|
||||
public final val w: R|kotlin/Boolean|
|
||||
public get(): R|kotlin/Boolean| {
|
||||
^ this@R|/<anonymous>|.R|/<anonymous>.z|
|
||||
}
|
||||
|
||||
public[local] final val z: R|kotlin/Boolean|
|
||||
public final val z: R|kotlin/Boolean|
|
||||
public get(): R|kotlin/Boolean| {
|
||||
^ ==(this@R|/<anonymous>|.R|kotlin/Any.hashCode|(), Int(0))
|
||||
}
|
||||
|
||||
+12
-12
@@ -3,24 +3,24 @@ FILE: implicitInLocalClasses.kt
|
||||
}
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
local final class A : R|kotlin/Any| {
|
||||
public[local] constructor(): R|A| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(x: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||
public final fun foo(x: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||
^foo this@R|/A|.R|/A.bar|(R|<local>/x|)
|
||||
}
|
||||
|
||||
public[local] final fun bar(y: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||
public final fun bar(y: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||
^bar CMP(>, this@R|/A|.R|kotlin/Any.hashCode|().R|kotlin/Int.plus|(R|<local>/y|).R|kotlin/Int.compareTo|(Int(0)))
|
||||
}
|
||||
|
||||
public[local] final val w: R|kotlin/Boolean|
|
||||
public final val w: R|kotlin/Boolean|
|
||||
public get(): R|kotlin/Boolean| {
|
||||
^ this@R|/A|.R|/A.z|
|
||||
}
|
||||
|
||||
public[local] final val z: R|kotlin/Boolean|
|
||||
public final val z: R|kotlin/Boolean|
|
||||
public get(): R|kotlin/Boolean| {
|
||||
^ ==(this@R|/A|.R|kotlin/Any.hashCode|(), Int(0))
|
||||
}
|
||||
@@ -33,32 +33,32 @@ FILE: implicitInLocalClasses.kt
|
||||
R|/useBoolean|(R|<local>/a|.R|/A.w|)
|
||||
R|/useBoolean|(R|<local>/a|.R|/A.z|)
|
||||
local final class B : R|kotlin/Any| {
|
||||
public[local] constructor(): R|B| {
|
||||
public constructor(): R|B| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(x: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||
public final fun foo(x: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||
^foo this@R|/B|.R|/B.inner|.R|/B.Inner.w|
|
||||
}
|
||||
|
||||
public[local] final fun bar(y: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||
public final fun bar(y: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||
^bar CMP(>, this@R|/B|.R|kotlin/Any.hashCode|().R|kotlin/Int.plus|(R|<local>/y|).R|kotlin/Int.compareTo|(Int(0)))
|
||||
}
|
||||
|
||||
public[local] final val inner: R|B.Inner| = this@R|/B|.R|/B.Inner.Inner|()
|
||||
public final val inner: R|B.Inner| = this@R|/B|.R|/B.Inner.Inner|()
|
||||
public get(): R|B.Inner|
|
||||
|
||||
local final inner class Inner : R|kotlin/Any| {
|
||||
public[local] constructor(): R|B.Inner| {
|
||||
public constructor(): R|B.Inner| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final val w: R|kotlin/Boolean|
|
||||
public final val w: R|kotlin/Boolean|
|
||||
public get(): R|kotlin/Boolean| {
|
||||
^ this@R|/B.Inner|.R|/B.Inner.z|
|
||||
}
|
||||
|
||||
public[local] final val z: R|kotlin/Boolean|
|
||||
public final val z: R|kotlin/Boolean|
|
||||
public get(): R|kotlin/Boolean| {
|
||||
^ this@R|/B|.R|/B.bar|(Int(1))
|
||||
}
|
||||
|
||||
+2
-2
@@ -12,11 +12,11 @@ FILE: typesFromSuperClasses.kt
|
||||
}
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
object : R|Outer| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|Outer|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(n: R|Outer.Nested|): R|kotlin/Unit| {
|
||||
public final fun foo(n: R|Outer.Nested|): R|kotlin/Unit| {
|
||||
R|<local>/n|.R|/Outer.Nested.bar|()
|
||||
}
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ FILE: localObject.kt
|
||||
public final fun tesLambda(x: R|kotlin/Int|): R|kotlin/Int| {
|
||||
^tesLambda R|/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| {
|
||||
lval obj: R|<anonymous>| = object : R|Foo| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final override fun foo(): R|kotlin/Int| {
|
||||
public final override fun foo(): R|kotlin/Int| {
|
||||
^foo R|<local>/x|.R|kotlin/Int.plus|(Int(1))
|
||||
}
|
||||
|
||||
@@ -35,11 +35,11 @@ FILE: localObject.kt
|
||||
public get(): R|kotlin/Int|
|
||||
public set(value: R|kotlin/Int|): R|kotlin/Unit| {
|
||||
lval obj: R|<anonymous>| = object : R|Foo| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final override fun foo(): R|kotlin/Int| {
|
||||
public final override fun foo(): R|kotlin/Int| {
|
||||
^foo this@R|/TestProperty|.R|/TestProperty.intConst|.R|kotlin/Int.plus|(Int(1))
|
||||
}
|
||||
|
||||
@@ -51,11 +51,11 @@ FILE: localObject.kt
|
||||
public final val y: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
lval obj: R|<anonymous>| = object : R|Foo| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final override fun foo(): R|kotlin/Int| {
|
||||
public final override fun foo(): R|kotlin/Int| {
|
||||
^foo this@R|/TestProperty|.R|/TestProperty.intConst|.R|kotlin/Int.plus|(Int(1))
|
||||
}
|
||||
|
||||
@@ -66,11 +66,11 @@ FILE: localObject.kt
|
||||
|
||||
public final val z: R|kotlin/Int| = this@R|/TestProperty|.R|kotlin/run|<R|TestProperty|, R|kotlin/Int|>(<L> = run@fun R|TestProperty|.<anonymous>(): R|kotlin/Int| <kind=EXACTLY_ONCE> {
|
||||
lval obj: R|<anonymous>| = object : R|Foo| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final override fun foo(): R|kotlin/Int| {
|
||||
public final override fun foo(): R|kotlin/Int| {
|
||||
^foo this@R|special/anonymous|.R|/TestProperty.x|.R|kotlin/Int.plus|(Int(1))
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
FILE: objectInnerClass.kt
|
||||
public final val case1: R|<anonymous>| = object : R|A| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
local final inner class Child : R|<anonymous>.Base| {
|
||||
public[local] constructor(property: R|B|): R|<anonymous>.Child| {
|
||||
public constructor(property: R|B|): R|<anonymous>.Child| {
|
||||
this@R|/<anonymous>|.super<R|<anonymous>.Base|>(R|<local>/property|)
|
||||
}
|
||||
|
||||
public[local] final fun R|<anonymous>.Base|.zoo(): R|kotlin/Unit| {
|
||||
public final fun R|<anonymous>.Base|.zoo(): R|kotlin/Unit| {
|
||||
lval x: R|B| = this@R|/<anonymous>.Child.zoo|.R|/<anonymous>.Base.property|
|
||||
}
|
||||
|
||||
public[local] final fun foo(): R|kotlin/Unit| {
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
this@R|/<anonymous>.Child|.R|/<anonymous>.Base.baseFun|()
|
||||
lval x: R|B| = this@R|/<anonymous>.Child|.R|/<anonymous>.Base.property|
|
||||
(this@R|/<anonymous>.Child|, this@R|/<anonymous>.Child|).R|/<anonymous>.Child.zoo|()
|
||||
@@ -22,35 +22,35 @@ FILE: objectInnerClass.kt
|
||||
|
||||
}
|
||||
|
||||
public[local] final fun R|<anonymous>.Child|.voo(): R|kotlin/Unit| {
|
||||
public final fun R|<anonymous>.Child|.voo(): R|kotlin/Unit| {
|
||||
lval x: R|B| = this@R|/<anonymous>.voo|.R|/<anonymous>.Base.property|
|
||||
}
|
||||
|
||||
public[local] final fun R|<anonymous>.Base|.hoo(): R|kotlin/Unit| {
|
||||
public final fun R|<anonymous>.Base|.hoo(): R|kotlin/Unit| {
|
||||
lval x: R|B| = this@R|/<anonymous>.hoo|.R|/<anonymous>.Base.property|
|
||||
}
|
||||
|
||||
local open inner class Base : R|kotlin/Any| {
|
||||
public[local] constructor(property: R|B|): R|<anonymous>.Base| {
|
||||
public constructor(property: R|B|): R|<anonymous>.Base| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final val property: R|B| = R|<local>/property|
|
||||
public final val property: R|B| = R|<local>/property|
|
||||
public get(): R|B|
|
||||
|
||||
public[local] final fun baseFun(): R|kotlin/Unit| {
|
||||
public final fun baseFun(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public[local] final fun caseForBase(): R|kotlin/Unit| {
|
||||
public final fun caseForBase(): R|kotlin/Unit| {
|
||||
lval base: R|<anonymous>.Base| = this@R|/<anonymous>|.R|/<anonymous>.Base.Base|(R|/B.B|())
|
||||
R|<local>/base|.R|/<anonymous>.Base.baseFun|()
|
||||
R|<local>/base|.R|/<anonymous>.Base.property|
|
||||
(this@R|/<anonymous>|, R|<local>/base|).R|/<anonymous>.hoo|()
|
||||
}
|
||||
|
||||
public[local] final fun caseForChild(): R|kotlin/Unit| {
|
||||
public final fun caseForChild(): R|kotlin/Unit| {
|
||||
lval child: R|<anonymous>.Child| = this@R|/<anonymous>|.R|/<anonymous>.Child.Child|(R|/B.B|())
|
||||
R|<local>/child|.R|/<anonymous>.Base.baseFun|()
|
||||
R|<local>/child|.R|/<anonymous>.Base.property|
|
||||
@@ -68,15 +68,15 @@ FILE: objectInnerClass.kt
|
||||
}
|
||||
|
||||
public final val x: R|<anonymous>| = object : R|Case2.Base| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
this@R|/Case2|.super<R|Case2.Base|>(R|/B.B|())
|
||||
}
|
||||
|
||||
public[local] final fun R|Case2.Base|.zoo(): R|kotlin/Unit| {
|
||||
public final fun R|Case2.Base|.zoo(): R|kotlin/Unit| {
|
||||
lval x: R|B| = this@R|/<anonymous>.zoo|.R|/Case2.Base.property|
|
||||
}
|
||||
|
||||
public[local] final fun foo(): R|kotlin/Unit| {
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
this@R|/<anonymous>|.R|/Case2.Base.baseFun|()
|
||||
lval x: R|B| = this@R|/<anonymous>|.R|/Case2.Base.property|
|
||||
(this@R|/<anonymous>|, this@R|/<anonymous>|).R|/<anonymous>.zoo|()
|
||||
@@ -125,20 +125,20 @@ FILE: objectInnerClass.kt
|
||||
}
|
||||
|
||||
public final val x: R|<anonymous>| = object : R|A| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
local final inner class Child : R|Case3.<anonymous>.Base| {
|
||||
public[local] constructor(property: R|B|): R|Case3.<anonymous>.Child| {
|
||||
public constructor(property: R|B|): R|Case3.<anonymous>.Child| {
|
||||
this@R|/<anonymous>|.super<R|Case3.<anonymous>.Base|>(R|<local>/property|)
|
||||
}
|
||||
|
||||
public[local] final fun R|Case3.<anonymous>.Base|.zoo(): R|kotlin/Unit| {
|
||||
public final fun R|Case3.<anonymous>.Base|.zoo(): R|kotlin/Unit| {
|
||||
lval x: R|B| = this@R|/Case3.<anonymous>.Child.zoo|.R|/Case3.<anonymous>.Base.property|
|
||||
}
|
||||
|
||||
public[local] final fun foo(): R|kotlin/Unit| {
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
this@R|/Case3.<anonymous>.Child|.R|/Case3.<anonymous>.Base.baseFun|()
|
||||
lval x: R|B| = this@R|/Case3.<anonymous>.Child|.R|/Case3.<anonymous>.Base.property|
|
||||
(this@R|/Case3.<anonymous>.Child|, this@R|/Case3.<anonymous>.Child|).R|/Case3.<anonymous>.Child.zoo|()
|
||||
@@ -147,35 +147,35 @@ FILE: objectInnerClass.kt
|
||||
|
||||
}
|
||||
|
||||
public[local] final fun R|Case3.<anonymous>.Child|.voo(): R|kotlin/Unit| {
|
||||
public final fun R|Case3.<anonymous>.Child|.voo(): R|kotlin/Unit| {
|
||||
lval x: R|B| = this@R|/<anonymous>.voo|.R|/Case3.<anonymous>.Base.property|
|
||||
}
|
||||
|
||||
public[local] final fun R|Case3.<anonymous>.Base|.hoo(): R|kotlin/Unit| {
|
||||
public final fun R|Case3.<anonymous>.Base|.hoo(): R|kotlin/Unit| {
|
||||
lval x: R|B| = this@R|/<anonymous>.hoo|.R|/Case3.<anonymous>.Base.property|
|
||||
}
|
||||
|
||||
local open inner class Base : R|kotlin/Any| {
|
||||
public[local] constructor(property: R|B|): R|Case3.<anonymous>.Base| {
|
||||
public constructor(property: R|B|): R|Case3.<anonymous>.Base| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final val property: R|B| = R|<local>/property|
|
||||
public final val property: R|B| = R|<local>/property|
|
||||
public get(): R|B|
|
||||
|
||||
public[local] final fun baseFun(): R|kotlin/Unit| {
|
||||
public final fun baseFun(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public[local] final fun caseForBase(): R|kotlin/Unit| {
|
||||
public final fun caseForBase(): R|kotlin/Unit| {
|
||||
lval base: R|Case3.<anonymous>.Base| = this@R|/<anonymous>|.R|/Case3.<anonymous>.Base.Base|(R|/B.B|())
|
||||
R|<local>/base|.R|/Case3.<anonymous>.Base.baseFun|()
|
||||
R|<local>/base|.R|/Case3.<anonymous>.Base.property|
|
||||
(this@R|/<anonymous>|, R|<local>/base|).R|/<anonymous>.hoo|()
|
||||
}
|
||||
|
||||
public[local] final fun caseForChild(): R|kotlin/Unit| {
|
||||
public final fun caseForChild(): R|kotlin/Unit| {
|
||||
lval child: R|Case3.<anonymous>.Child| = this@R|/<anonymous>|.R|/Case3.<anonymous>.Child.Child|(R|/B.B|())
|
||||
R|<local>/child|.R|/Case3.<anonymous>.Base.baseFun|()
|
||||
R|<local>/child|.R|/Case3.<anonymous>.Base.property|
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ FILE: objectDerivedFromInnerClass.kt
|
||||
}
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
lval x: R|<anonymous>| = object : R|Outer.Inner| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|Outer.Inner|>()
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -6,24 +6,24 @@ FILE: lambdaInWhenBranch.kt
|
||||
|
||||
}
|
||||
private final data class SubClass1 : R|Sealed| {
|
||||
public[private] constructor(t: R|kotlin/String|): R|SubClass1| {
|
||||
public constructor(t: R|kotlin/String|): R|SubClass1| {
|
||||
super<R|Sealed|>()
|
||||
}
|
||||
|
||||
public[private] final val t: R|kotlin/String| = R|<local>/t|
|
||||
public final val t: R|kotlin/String| = R|<local>/t|
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
public[private] final fun component1(): R|kotlin/String|
|
||||
public final fun component1(): R|kotlin/String|
|
||||
|
||||
public[private] final fun copy(t: R|kotlin/String| = this@R|/SubClass1|.R|/SubClass1.t|): R|SubClass1|
|
||||
public final fun copy(t: R|kotlin/String| = this@R|/SubClass1|.R|/SubClass1.t|): R|SubClass1|
|
||||
|
||||
}
|
||||
private final data class SubClass2 : R|Sealed| {
|
||||
public[private] constructor(): R|SubClass2| {
|
||||
public constructor(): R|SubClass2| {
|
||||
super<R|Sealed|>()
|
||||
}
|
||||
|
||||
public[private] final fun copy(): R|SubClass2|
|
||||
public final fun copy(): R|SubClass2|
|
||||
|
||||
}
|
||||
private final fun foo(p: R|Sealed|): R|kotlin/Unit| {
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ FILE: exposedFunctionParameterType.kt
|
||||
}
|
||||
|
||||
private final class AInner : R|kotlin/Any| {
|
||||
public[private] constructor(): R|A.AInner| {
|
||||
public constructor(): R|A.AInner| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -5,7 +5,7 @@ FILE: exposedFunctionReturnType.kt
|
||||
}
|
||||
|
||||
private final class InnerA : R|kotlin/Any| {
|
||||
public[private] constructor(): R|A.InnerA| {
|
||||
public constructor(): R|A.InnerA| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
@@ -20,4 +20,3 @@ FILE: exposedFunctionReturnType.kt
|
||||
public final fun foo(str: R|kotlin/String|): R|A.InnerA|
|
||||
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -5,11 +5,11 @@ FILE: exposedPropertyType.kt
|
||||
}
|
||||
|
||||
private final class AInnerPrivate : R|kotlin/Any| {
|
||||
public[private] constructor(str: R|kotlin/String|): R|A.AInnerPrivate| {
|
||||
public constructor(str: R|kotlin/String|): R|A.AInnerPrivate| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[private] final val str: R|kotlin/String| = R|<local>/str|
|
||||
public final val str: R|kotlin/String| = R|<local>/str|
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
}
|
||||
@@ -21,10 +21,10 @@ FILE: exposedPropertyType.kt
|
||||
|
||||
public final static enum entry A: R|A.AInnerProtectedEnum|
|
||||
public final static enum entry B: R|A.AInnerProtectedEnum|
|
||||
public[protected] final static fun values(): R|kotlin/Array<A.AInnerProtectedEnum>| {
|
||||
public final static fun values(): R|kotlin/Array<A.AInnerProtectedEnum>| {
|
||||
}
|
||||
|
||||
public[protected] final static fun valueOf(value: R|kotlin/String|): R|A.AInnerProtectedEnum| {
|
||||
public final static fun valueOf(value: R|kotlin/String|): R|A.AInnerProtectedEnum| {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -69,4 +69,4 @@ FILE: exposedPropertyType.kt
|
||||
public get(): R|A.AInnerProtectedEnum|
|
||||
public set(value: R|A.AInnerProtectedEnum|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -17,7 +17,7 @@ FILE: exposedSupertype.kt
|
||||
}
|
||||
|
||||
protected final class BProtected : R|kotlin/Any| {
|
||||
public[protected] constructor(): R|B.BProtected| {
|
||||
public constructor(): R|B.BProtected| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
@@ -32,18 +32,18 @@ FILE: exposedSupertype.kt
|
||||
|
||||
}
|
||||
private final class C : R|kotlin/Any| {
|
||||
public[private] constructor(): R|C| {
|
||||
public constructor(): R|C| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[private] final class CPublic : R|kotlin/Any| {
|
||||
public[private] constructor(): R|C.CPublic| {
|
||||
public final class CPublic : R|kotlin/Any| {
|
||||
public constructor(): R|C.CPublic| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public[private] abstract interface CPublicI : R|kotlin/Any| {
|
||||
public abstract interface CPublicI : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ FILE: exposedTypeAlias.kt
|
||||
}
|
||||
|
||||
private final inner class Inner : R|kotlin/Any| {
|
||||
public[private] constructor(): R|A.Inner| {
|
||||
public constructor(): R|A.Inner| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -1,12 +1,12 @@
|
||||
FILE: exposedTypeParameters.kt
|
||||
private open class A : R|kotlin/Any| {
|
||||
public[private] constructor(): R|A| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
internal open class B : R|kotlin/Any| {
|
||||
public[internal] constructor(): R|B| {
|
||||
public constructor(): R|B| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ FILE: exposedTypeParameters.kt
|
||||
}
|
||||
|
||||
protected open class D : R|kotlin/Any| {
|
||||
public[protected] constructor(): R|C.D| {
|
||||
public constructor(): R|C.D| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
@@ -49,13 +49,13 @@ FILE: exposedTypeParameters.kt
|
||||
|
||||
}
|
||||
internal final class Test4<T : R|B|> : R|kotlin/Any| {
|
||||
public[internal] constructor<T : R|B|>(): R|Test4<T>| {
|
||||
public constructor<T : R|B|>(): R|Test4<T>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
private final class Test5<T : R|B|> : R|kotlin/Any| {
|
||||
public[private] constructor<T : R|B|>(): R|Test5<T>| {
|
||||
public constructor<T : R|B|>(): R|Test5<T>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
@@ -66,14 +66,14 @@ FILE: exposedTypeParameters.kt
|
||||
}
|
||||
|
||||
protected final class Test6<T : R|C.D|> : R|kotlin/Any| {
|
||||
public[protected] constructor<T : R|C.D|>(): R|Container.Test6<T>| {
|
||||
public constructor<T : R|C.D|>(): R|Container.Test6<T>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected final class Test7<T : R|B|> : R|kotlin/Any| {
|
||||
public[protected] constructor<T : R|B|>(): R|Container.Test7<T>| {
|
||||
public constructor<T : R|B|>(): R|Container.Test7<T>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ FILE: singletonConstructors.kt
|
||||
}
|
||||
|
||||
public final static enum entry X: R|E| = object : R|E| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|E|>()
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -5,11 +5,11 @@ FILE: anonymousInDelegate.kt
|
||||
}
|
||||
public final val x: R|kotlin/Int|by R|kotlin/lazy|<R|kotlin/Int|>(<L> = lazy@fun <anonymous>(): R|kotlin/Int| {
|
||||
lval foo: R|<anonymous>| = object : R|Foo| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final override fun bar(): R|kotlin/Int| {
|
||||
public final override fun bar(): R|kotlin/Int| {
|
||||
^bar Int(42)
|
||||
}
|
||||
|
||||
|
||||
Vendored
+3
-3
@@ -24,15 +24,15 @@ FILE: delegateWithAnonymousObject.kt
|
||||
|
||||
public final var issueListView: R|IssueListView|by this@R|/IssuesListUserProfile|.R|/delegate|<R|IssuesListUserProfile|, R|IssuesListUserProfile|, R|IssueListView|>(<L> = delegate@fun <anonymous>(): R|kotlin/properties/ReadWriteProperty<IssuesListUserProfile, IssueListView>| {
|
||||
^ object : R|kotlin/properties/ReadWriteProperty<IssuesListUserProfile, IssueListView>| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final override fun getValue(thisRef: R|IssuesListUserProfile|, property: R|kotlin/reflect/KProperty<*>|): R|IssueListView| {
|
||||
public final override fun getValue(thisRef: R|IssuesListUserProfile|, property: R|kotlin/reflect/KProperty<*>|): R|IssueListView| {
|
||||
^getValue R|/IssueListView.IssueListView|()
|
||||
}
|
||||
|
||||
public[local] final override fun setValue(thisRef: R|IssuesListUserProfile|, property: R|kotlin/reflect/KProperty<*>|, value: R|IssueListView|): R|kotlin/Unit| {
|
||||
public final override fun setValue(thisRef: R|IssuesListUserProfile|, property: R|kotlin/reflect/KProperty<*>|, value: R|IssueListView|): R|kotlin/Unit| {
|
||||
^setValue R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(R|<local>/value|)
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -27,17 +27,17 @@ FILE: hashTableWithForEach.kt
|
||||
}
|
||||
|
||||
private final class Entry<K, V> : R|kotlin/collections/MutableMap.MutableEntry<K, V>| {
|
||||
public[private] constructor<K, V>(key: R|K|, value: R|V|): R|SomeHashTable.Entry<K, V>| {
|
||||
public constructor<K, V>(key: R|K|, value: R|V|): R|SomeHashTable.Entry<K, V>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[private] final override val key: R|K| = R|<local>/key|
|
||||
public final override val key: R|K| = R|<local>/key|
|
||||
public get(): R|K|
|
||||
|
||||
public[private] final override val value: R|V| = R|<local>/value|
|
||||
public final override val value: R|V| = R|<local>/value|
|
||||
public get(): R|V|
|
||||
|
||||
public[private] final override fun setValue(newValue: R|V|): R|V| {
|
||||
public final override fun setValue(newValue: R|V|): R|V| {
|
||||
^setValue throw R|java/lang/UnsupportedOperationException.UnsupportedOperationException|()
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ fun test(e: MyException, stream: PrintStream) {
|
||||
val result = e.getLocalizedMessage()
|
||||
}
|
||||
|
||||
fun test(e: YourException, stream: PrintStream) {
|
||||
fun test(<!EXPOSED_PARAMETER_TYPE!>e: YourException<!>, stream: PrintStream) {
|
||||
e.printStackTrace()
|
||||
e.printStackTrace(stream)
|
||||
val result = e.getLocalizedMessage()
|
||||
|
||||
@@ -2,14 +2,14 @@ FILE: problems.kt
|
||||
public final val sb: R|java/lang/StringBuilder| = R|java/lang/StringBuilder.StringBuilder|()
|
||||
public get(): R|java/lang/StringBuilder|
|
||||
public final val o: R|<anonymous>| = object : R|kotlin/Any| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final val name: R|kotlin/String| = String(123)
|
||||
public final val name: R|kotlin/String| = String(123)
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
public[local] final fun test(): R|kotlin/Unit| {
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
this@R|/<anonymous>|.R|/<anonymous>.name|
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ FILE: problems.kt
|
||||
public get(): R|<anonymous>|
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
local final class Local : R|kotlin/Any| {
|
||||
public[local] constructor(): R|Local| {
|
||||
public constructor(): R|Local| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ object CommonDeclarationCheckers : DeclarationCheckers() {
|
||||
|
||||
override val memberDeclarationCheckers: List<FirMemberDeclarationChecker> = listOf(
|
||||
FirInfixFunctionDeclarationChecker,
|
||||
FirExposedVisibilityChecker
|
||||
FirExposedVisibilityDeclarationChecker,
|
||||
)
|
||||
|
||||
override val constructorCheckers: List<FirConstructorChecker> = listOf(
|
||||
|
||||
+50
-45
@@ -10,7 +10,6 @@ import com.intellij.openapi.util.Ref
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiNameIdentifierOwner
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.descriptors.RelationToType
|
||||
import org.jetbrains.kotlin.fir.*
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.toRegularClass
|
||||
@@ -24,23 +23,23 @@ import org.jetbrains.kotlin.lexer.KtTokens
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
// TODO: check why coneTypeSafe is necessary at some points inside
|
||||
object FirExposedVisibilityChecker : FirMemberDeclarationChecker() {
|
||||
object FirExposedVisibilityDeclarationChecker : FirMemberDeclarationChecker() {
|
||||
override fun check(declaration: FirMemberDeclaration, context: CheckerContext, reporter: DiagnosticReporter) {
|
||||
when (declaration) {
|
||||
is FirTypeAlias -> checkTypeAlias(declaration, reporter)
|
||||
is FirProperty -> checkProperty(declaration, reporter)
|
||||
is FirFunction<*> -> checkFunction(declaration, reporter)
|
||||
is FirRegularClass -> checkClass(declaration, reporter)
|
||||
is FirTypeAlias -> checkTypeAlias(declaration, reporter, context)
|
||||
is FirProperty -> checkProperty(declaration, reporter, context)
|
||||
is FirFunction<*> -> checkFunction(declaration, reporter, context)
|
||||
is FirRegularClass -> checkClass(declaration, reporter, context)
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkClass(declaration: FirRegularClass, reporter: DiagnosticReporter) {
|
||||
checkSupertypes(declaration, reporter)
|
||||
checkParameterBounds(declaration, reporter)
|
||||
private fun checkClass(declaration: FirRegularClass, reporter: DiagnosticReporter, context: CheckerContext) {
|
||||
checkSupertypes(declaration, reporter, context)
|
||||
checkParameterBounds(declaration, reporter, context)
|
||||
}
|
||||
|
||||
private fun checkSupertypes(declaration: FirRegularClass, reporter: DiagnosticReporter) {
|
||||
val classVisibility = declaration.effectiveVisibility
|
||||
private fun checkSupertypes(declaration: FirRegularClass, reporter: DiagnosticReporter, context: CheckerContext) {
|
||||
val classVisibility = declaration.getEffectiveVisibility(context)
|
||||
val supertypes = declaration.superTypeRefs
|
||||
val isInterface = declaration.classKind == ClassKind.INTERFACE
|
||||
for (supertypeRef in supertypes) {
|
||||
@@ -50,30 +49,30 @@ object FirExposedVisibilityChecker : FirMemberDeclarationChecker() {
|
||||
if (superIsInterface != isInterface) {
|
||||
continue
|
||||
}
|
||||
val restricting = supertype.findVisibilityExposure(declaration.session, classVisibility)
|
||||
val restricting = supertype.findVisibilityExposure(context, classVisibility)
|
||||
if (restricting != null) {
|
||||
reporter.reportExposure(
|
||||
if (isInterface) FirErrors.EXPOSED_SUPER_INTERFACE else FirErrors.EXPOSED_SUPER_CLASS,
|
||||
restricting,
|
||||
classVisibility,
|
||||
restricting.effectiveVisibility,
|
||||
restricting.getEffectiveVisibility(context),
|
||||
supertypeRef.source ?: declaration.source
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkParameterBounds(declaration: FirRegularClass, reporter: DiagnosticReporter) {
|
||||
val classVisibility = declaration.effectiveVisibility
|
||||
private fun checkParameterBounds(declaration: FirRegularClass, reporter: DiagnosticReporter, context: CheckerContext) {
|
||||
val classVisibility = declaration.getEffectiveVisibility(context)
|
||||
for (parameter in declaration.typeParameters) {
|
||||
for (bound in parameter.symbol.fir.bounds) {
|
||||
val restricting = bound.coneType.findVisibilityExposure(declaration.session, classVisibility)
|
||||
val restricting = bound.coneType.findVisibilityExposure(context, classVisibility)
|
||||
if (restricting != null) {
|
||||
reporter.reportExposure(
|
||||
FirErrors.EXPOSED_TYPE_PARAMETER_BOUND,
|
||||
restricting,
|
||||
classVisibility,
|
||||
restricting.effectiveVisibility,
|
||||
restricting.getEffectiveVisibility(context),
|
||||
bound.source
|
||||
)
|
||||
}
|
||||
@@ -81,32 +80,33 @@ object FirExposedVisibilityChecker : FirMemberDeclarationChecker() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkTypeAlias(declaration: FirTypeAlias, reporter: DiagnosticReporter) {
|
||||
private fun checkTypeAlias(declaration: FirTypeAlias, reporter: DiagnosticReporter, context: CheckerContext) {
|
||||
val expandedType = declaration.expandedConeType
|
||||
val typeAliasVisibility = declaration.firEffectiveVisibility(declaration.session)
|
||||
val restricting = expandedType?.findVisibilityExposure(declaration.session, typeAliasVisibility)
|
||||
val typeAliasVisibility = declaration.getEffectiveVisibility(context)
|
||||
val restricting = expandedType?.findVisibilityExposure(context, typeAliasVisibility)
|
||||
if (restricting != null) {
|
||||
reporter.reportExposure(
|
||||
FirErrors.EXPOSED_TYPEALIAS_EXPANDED_TYPE,
|
||||
restricting,
|
||||
typeAliasVisibility,
|
||||
restricting.effectiveVisibility,
|
||||
restricting.getEffectiveVisibility(context),
|
||||
declaration.source?.getIdentifierSource() ?: declaration.source
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkFunction(declaration: FirFunction<*>, reporter: DiagnosticReporter) {
|
||||
val functionVisibility = (declaration as FirMemberDeclaration).effectiveVisibility
|
||||
private fun checkFunction(declaration: FirFunction<*>, reporter: DiagnosticReporter, context: CheckerContext) {
|
||||
val functionVisibility =
|
||||
(declaration as FirMemberDeclaration).getEffectiveVisibility(context)
|
||||
if (declaration !is FirConstructor) {
|
||||
val restricting = declaration.returnTypeRef.coneTypeSafe<ConeKotlinType>()
|
||||
?.findVisibilityExposure(declaration.session, functionVisibility)
|
||||
?.findVisibilityExposure(context, functionVisibility)
|
||||
if (restricting != null) {
|
||||
reporter.reportExposure(
|
||||
FirErrors.EXPOSED_FUNCTION_RETURN_TYPE,
|
||||
restricting,
|
||||
functionVisibility,
|
||||
restricting.effectiveVisibility,
|
||||
restricting.getEffectiveVisibility(context),
|
||||
declaration.source?.getIdentifierSource() ?: declaration.source
|
||||
)
|
||||
}
|
||||
@@ -115,69 +115,71 @@ object FirExposedVisibilityChecker : FirMemberDeclarationChecker() {
|
||||
if (i < declaration.valueParameters.size) {
|
||||
val restricting =
|
||||
valueParameter.returnTypeRef.coneTypeSafe<ConeKotlinType>()
|
||||
?.findVisibilityExposure(declaration.session, functionVisibility)
|
||||
?.findVisibilityExposure(context, functionVisibility)
|
||||
if (restricting != null) {
|
||||
reporter.reportExposure(
|
||||
FirErrors.EXPOSED_PARAMETER_TYPE,
|
||||
restricting,
|
||||
functionVisibility,
|
||||
restricting.effectiveVisibility,
|
||||
restricting.getEffectiveVisibility(context),
|
||||
valueParameter.source
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
checkMemberReceiver(declaration.receiverTypeRef, declaration as? FirCallableMemberDeclaration<*>, reporter)
|
||||
checkMemberReceiver(declaration.receiverTypeRef, declaration as? FirCallableMemberDeclaration<*>, reporter, context)
|
||||
}
|
||||
|
||||
private fun checkProperty(declaration: FirProperty, reporter: DiagnosticReporter) {
|
||||
val propertyVisibility = declaration.effectiveVisibility
|
||||
private fun checkProperty(declaration: FirProperty, reporter: DiagnosticReporter, context: CheckerContext) {
|
||||
val propertyVisibility = declaration.getEffectiveVisibility(context)
|
||||
val restricting =
|
||||
declaration.returnTypeRef.coneTypeSafe<ConeKotlinType>()
|
||||
?.findVisibilityExposure(declaration.session, propertyVisibility)
|
||||
?.findVisibilityExposure(context, propertyVisibility)
|
||||
if (restricting != null) {
|
||||
reporter.reportExposure(
|
||||
FirErrors.EXPOSED_PROPERTY_TYPE,
|
||||
restricting,
|
||||
propertyVisibility,
|
||||
restricting.effectiveVisibility,
|
||||
restricting.getEffectiveVisibility(context),
|
||||
declaration.source?.getIdentifierSource() ?: declaration.source
|
||||
)
|
||||
}
|
||||
checkMemberReceiver(declaration.receiverTypeRef, declaration, reporter)
|
||||
checkMemberReceiver(declaration.receiverTypeRef, declaration, reporter, context)
|
||||
}
|
||||
|
||||
private fun checkMemberReceiver(
|
||||
typeRef: FirTypeRef?,
|
||||
memberDeclaration: FirCallableMemberDeclaration<*>?, reporter: DiagnosticReporter
|
||||
memberDeclaration: FirCallableMemberDeclaration<*>?,
|
||||
reporter: DiagnosticReporter,
|
||||
context: CheckerContext
|
||||
) {
|
||||
if (typeRef == null || memberDeclaration == null) return
|
||||
val receiverParameterType = typeRef.coneType
|
||||
val memberVisibility = memberDeclaration.effectiveVisibility
|
||||
val restricting = receiverParameterType.findVisibilityExposure(memberDeclaration.session, memberVisibility)
|
||||
val memberVisibility = memberDeclaration.getEffectiveVisibility(context)
|
||||
val restricting = receiverParameterType.findVisibilityExposure(context, memberVisibility)
|
||||
if (restricting != null) {
|
||||
reporter.reportExposure(
|
||||
FirErrors.EXPOSED_RECEIVER_TYPE,
|
||||
restricting,
|
||||
memberVisibility,
|
||||
restricting.effectiveVisibility,
|
||||
restricting.getEffectiveVisibility(context),
|
||||
typeRef.source
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun ConeKotlinType.findVisibilityExposure(session: FirSession, base: FirEffectiveVisibility): FirMemberDeclaration? {
|
||||
private fun ConeKotlinType.findVisibilityExposure(
|
||||
context: CheckerContext,
|
||||
base: FirEffectiveVisibility
|
||||
): FirMemberDeclaration? {
|
||||
val type = this as? ConeClassLikeType
|
||||
?: return null
|
||||
val fir = type.lookupTag.toSymbol(session)
|
||||
val fir = type.lookupTag.toSymbol(context.session)
|
||||
?.fir
|
||||
?: return null
|
||||
|
||||
if (
|
||||
fir is FirMemberDeclaration &&
|
||||
fir.effectiveVisibility != FirEffectiveVisibility.Default // because abstract interface List<out T> returns it here
|
||||
) {
|
||||
when (fir.effectiveVisibility.relation(base)) {
|
||||
if (fir is FirMemberDeclaration) {
|
||||
when (fir.getEffectiveVisibility(context).relation(base)) {
|
||||
FirEffectiveVisibility.Permissiveness.LESS,
|
||||
FirEffectiveVisibility.Permissiveness.UNKNOWN -> {
|
||||
return fir
|
||||
@@ -188,7 +190,7 @@ object FirExposedVisibilityChecker : FirMemberDeclarationChecker() {
|
||||
}
|
||||
|
||||
for (it in type.typeArguments) {
|
||||
it.safeAs<ConeClassLikeType>()?.findVisibilityExposure(session, base)?.let {
|
||||
it.safeAs<ConeClassLikeType>()?.findVisibilityExposure(context, base)?.let {
|
||||
return it
|
||||
}
|
||||
}
|
||||
@@ -224,4 +226,7 @@ object FirExposedVisibilityChecker : FirMemberDeclarationChecker() {
|
||||
identifier?.toFirLightSourceElement(this.tree.getStartOffset(identifier), this.tree.getEndOffset(identifier), this.tree)
|
||||
}
|
||||
}
|
||||
|
||||
private fun FirMemberDeclaration.getEffectiveVisibility(context: CheckerContext) =
|
||||
getEffectiveVisibility(context.session, context.containingDeclarations, context.sessionHolder.scopeSession)
|
||||
}
|
||||
+1
-1
@@ -73,7 +73,7 @@ class FirJvmSerializerExtension @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun shouldSerializeNestedClass(nestedClass: FirRegularClass): Boolean {
|
||||
return classBuilderMode != ClassBuilderMode.ABI || nestedClass.effectiveVisibility != FirEffectiveVisibilityImpl.Private
|
||||
return classBuilderMode != ClassBuilderMode.ABI || nestedClass.visibility != Visibilities.PRIVATE
|
||||
}
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
|
||||
+1
-3
@@ -6,11 +6,9 @@
|
||||
package org.jetbrains.kotlin.fir.signaturer
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
||||
import org.jetbrains.kotlin.fir.FirEffectiveVisibilityImpl
|
||||
import org.jetbrains.kotlin.fir.FirElement
|
||||
import org.jetbrains.kotlin.fir.*
|
||||
import org.jetbrains.kotlin.fir.backend.Fir2IrSignatureComposer
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.render
|
||||
import org.jetbrains.kotlin.fir.symbols.CallableId
|
||||
import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid
|
||||
import org.jetbrains.kotlin.ir.util.IdSignature
|
||||
|
||||
@@ -10,11 +10,12 @@ import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.fir.*
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.*
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.java.declarations.*
|
||||
import org.jetbrains.kotlin.fir.resolve.constructType
|
||||
import org.jetbrains.kotlin.fir.resolve.providers.AbstractFirSymbolProvider
|
||||
@@ -37,6 +38,7 @@ import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.jvm.KotlinJavaPsiFacade
|
||||
import org.jetbrains.kotlin.types.Variance.INVARIANT
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions
|
||||
|
||||
class JavaSymbolProvider(
|
||||
val session: FirSession,
|
||||
@@ -178,6 +180,16 @@ class JavaSymbolProvider(
|
||||
buildOuterClassTypeParameterRef { symbol = it.symbol }
|
||||
}
|
||||
}
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
javaClass.visibility,
|
||||
javaClass.modality
|
||||
).apply {
|
||||
this.isInner = !isTopLevel && !this@buildJavaClass.isStatic
|
||||
isCompanion = false
|
||||
isData = false
|
||||
isInline = false
|
||||
isFun = classKind == ClassKind.INTERFACE
|
||||
}
|
||||
addAnnotationsFrom(this@JavaSymbolProvider.session, javaClass, javaTypeParameterStack)
|
||||
// TODO: may be we can process fields & methods later.
|
||||
// However, they should be built up to override resolve stage
|
||||
@@ -191,7 +203,10 @@ class JavaSymbolProvider(
|
||||
session = this@JavaSymbolProvider.session
|
||||
symbol = FirVariableSymbol(fieldId)
|
||||
name = fieldName
|
||||
status = FirDeclarationStatusImpl(javaField.visibility, javaField.modality).apply {
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
javaField.visibility,
|
||||
javaField.modality
|
||||
).apply {
|
||||
isStatic = javaField.isStatic
|
||||
isExpect = false
|
||||
isActual = false
|
||||
@@ -207,6 +222,15 @@ class JavaSymbolProvider(
|
||||
session = this@JavaSymbolProvider.session
|
||||
symbol = FirFieldSymbol(fieldId)
|
||||
name = fieldName
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
javaField.visibility,
|
||||
javaField.modality
|
||||
).apply {
|
||||
isStatic = javaField.isStatic
|
||||
isExpect = false
|
||||
isActual = false
|
||||
isOverride = false
|
||||
}
|
||||
visibility = javaField.visibility
|
||||
modality = javaField.modality
|
||||
returnTypeRef = returnType.toFirJavaTypeRef(this@JavaSymbolProvider.session, javaTypeParameterStack)
|
||||
@@ -238,6 +262,23 @@ class JavaSymbolProvider(
|
||||
this@JavaSymbolProvider.session, index, javaTypeParameterStack,
|
||||
)
|
||||
}
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
javaMethod.visibility,
|
||||
javaMethod.modality
|
||||
).apply {
|
||||
isStatic = javaMethod.isStatic
|
||||
isExpect = false
|
||||
isActual = false
|
||||
isOverride = false
|
||||
// Approximation: all Java methods with name that allows to use it in operator form are considered operators
|
||||
// We need here more detailed checks (see modifierChecks.kt)
|
||||
isOperator = name in ALL_JAVA_OPERATION_NAMES || OperatorNameConventions.COMPONENT_REGEX.matches(name.asString())
|
||||
isInfix = false
|
||||
isInline = false
|
||||
isTailRec = false
|
||||
isExternal = false
|
||||
isSuspend = false
|
||||
}
|
||||
}
|
||||
declarations += firJavaMethod
|
||||
}
|
||||
@@ -254,9 +295,19 @@ class JavaSymbolProvider(
|
||||
source = psi?.toFirPsiSourceElement()
|
||||
session = this@JavaSymbolProvider.session
|
||||
symbol = constructorSymbol
|
||||
isInner = javaClass.outerClass != null && !javaClass.isStatic
|
||||
val isThisInner = this.isInner
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
visibility,
|
||||
Modality.FINAL
|
||||
).apply {
|
||||
isExpect = false
|
||||
isActual = false
|
||||
isOverride = false
|
||||
isInner = isThisInner
|
||||
}
|
||||
this.visibility = visibility
|
||||
this.isPrimary = isPrimary
|
||||
isInner = javaClass.outerClass != null && !javaClass.isStatic
|
||||
returnTypeRef = buildResolvedTypeRef {
|
||||
type = firSymbol.constructType(
|
||||
this@buildJavaClass.typeParameters.map { ConeTypeParameterTypeImpl(it.symbol.toLookupTag(), false) }.toTypedArray(),
|
||||
@@ -274,7 +325,8 @@ class JavaSymbolProvider(
|
||||
}
|
||||
for (javaConstructor in javaClassDeclaredConstructors) {
|
||||
declarations += prepareJavaConstructor(
|
||||
visibility = javaConstructor.visibility, psi = (javaConstructor as? JavaElementImpl<*>)?.psi,
|
||||
visibility = javaConstructor.visibility,
|
||||
psi = (javaConstructor as? JavaElementImpl<*>)?.psi,
|
||||
).apply {
|
||||
this.typeParameters += javaConstructor.typeParameters.convertTypeParameters(javaTypeParameterStack)
|
||||
addAnnotationsFrom(this@JavaSymbolProvider.session, javaConstructor, javaTypeParameterStack)
|
||||
|
||||
@@ -15,7 +15,6 @@ import org.jetbrains.kotlin.fir.builder.FirAnnotationContainerBuilder
|
||||
import org.jetbrains.kotlin.fir.builder.FirBuilderDsl
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.FirRegularClassBuilder
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||
import org.jetbrains.kotlin.fir.java.JavaTypeParameterStack
|
||||
import org.jetbrains.kotlin.fir.references.FirControlFlowGraphReference
|
||||
@@ -142,15 +141,6 @@ internal class FirJavaClassBuilder : FirRegularClassBuilder(), FirAnnotationCont
|
||||
|
||||
@OptIn(FirImplementationDetail::class)
|
||||
override fun build(): FirJavaClass {
|
||||
val isInner = !isTopLevel && !isStatic
|
||||
val status = FirDeclarationStatusImpl(visibility, modality).apply {
|
||||
this.isInner = isInner
|
||||
isCompanion = false
|
||||
isData = false
|
||||
isInline = false
|
||||
isFun = classKind == ClassKind.INTERFACE
|
||||
}
|
||||
|
||||
return FirJavaClass(
|
||||
source,
|
||||
session,
|
||||
|
||||
+3
-17
@@ -5,13 +5,13 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.java.declarations
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.fir.*
|
||||
import org.jetbrains.kotlin.fir.FirImplementationDetail
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.FirSourceElement
|
||||
import org.jetbrains.kotlin.fir.builder.FirBuilderDsl
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.FirConstructorBuilder
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirBlock
|
||||
import org.jetbrains.kotlin.fir.expressions.FirDelegatedConstructorCall
|
||||
@@ -144,13 +144,6 @@ class FirJavaConstructorBuilder : FirConstructorBuilder() {
|
||||
|
||||
@OptIn(FirImplementationDetail::class)
|
||||
override fun build(): FirJavaConstructor {
|
||||
val status = FirDeclarationStatusImpl(visibility, Modality.FINAL).apply {
|
||||
isExpect = false
|
||||
isActual = false
|
||||
isOverride = false
|
||||
isInner = this@FirJavaConstructorBuilder.isInner
|
||||
}
|
||||
|
||||
return FirJavaConstructor(
|
||||
source,
|
||||
session,
|
||||
@@ -186,13 +179,6 @@ class FirJavaConstructorBuilder : FirConstructorBuilder() {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
|
||||
@Deprecated("Modification of 'status' has no impact for FirJavaConstructorBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var status: FirDeclarationStatus
|
||||
get() = throw IllegalStateException()
|
||||
set(value) {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
|
||||
@Deprecated("Modification of 'receiverTypeRef' has no impact for FirJavaConstructorBuilder", level = DeprecationLevel.HIDDEN)
|
||||
override var receiverTypeRef: FirTypeRef?
|
||||
get() = throw IllegalStateException()
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.java.declarations
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.fir.FirImplementationDetail
|
||||
@@ -14,6 +15,7 @@ import org.jetbrains.kotlin.fir.builder.FirBuilderDsl
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.FirFieldBuilder
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirDelegateFieldSymbol
|
||||
@@ -147,13 +149,6 @@ internal class FirJavaFieldBuilder : FirFieldBuilder() {
|
||||
|
||||
@OptIn(FirImplementationDetail::class)
|
||||
override fun build(): FirJavaField {
|
||||
val status: FirDeclarationStatus = FirDeclarationStatusImpl(visibility, modality).apply {
|
||||
isStatic = this@FirJavaFieldBuilder.isStatic
|
||||
isExpect = false
|
||||
isActual = false
|
||||
isOverride = false
|
||||
}
|
||||
|
||||
return FirJavaField(
|
||||
source,
|
||||
session,
|
||||
|
||||
@@ -14,7 +14,6 @@ import org.jetbrains.kotlin.fir.builder.FirBuilderDsl
|
||||
import org.jetbrains.kotlin.fir.contracts.impl.FirEmptyContractDescription
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.FirSimpleFunctionBuilder
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirSimpleFunctionImpl
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirBlock
|
||||
@@ -23,7 +22,6 @@ import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
import org.jetbrains.kotlin.fir.types.jvm.FirJavaTypeRef
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions.ASSIGNMENT_OPERATIONS
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions.BINARY_OPERATION_NAMES
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions.COMPARE_TO
|
||||
@@ -72,7 +70,7 @@ class FirJavaMethod @FirImplementationDetail constructor(
|
||||
typeParameters,
|
||||
)
|
||||
|
||||
private val ALL_JAVA_OPERATION_NAMES =
|
||||
val ALL_JAVA_OPERATION_NAMES =
|
||||
UNARY_OPERATION_NAMES + BINARY_OPERATION_NAMES + ASSIGNMENT_OPERATIONS + DELEGATED_PROPERTY_OPERATORS +
|
||||
EQUALS + COMPARE_TO + CONTAINS + INVOKE + ITERATOR + GET + SET + NEXT + HAS_NEXT
|
||||
|
||||
@@ -92,21 +90,6 @@ class FirJavaMethodBuilder : FirSimpleFunctionBuilder() {
|
||||
|
||||
@OptIn(FirImplementationDetail::class)
|
||||
override fun build(): FirJavaMethod {
|
||||
val status = FirDeclarationStatusImpl(visibility, modality).apply {
|
||||
isStatic = this@FirJavaMethodBuilder.isStatic
|
||||
isExpect = false
|
||||
isActual = false
|
||||
isOverride = false
|
||||
// Approximation: all Java methods with name that allows to use it in operator form are considered operators
|
||||
// We need here more detailed checks (see modifierChecks.kt)
|
||||
isOperator = name in ALL_JAVA_OPERATION_NAMES || OperatorNameConventions.COMPONENT_REGEX.matches(name.asString())
|
||||
isInfix = false
|
||||
isInline = false
|
||||
isTailRec = false
|
||||
isExternal = false
|
||||
isSuspend = false
|
||||
}
|
||||
|
||||
return FirJavaMethod(
|
||||
source,
|
||||
session,
|
||||
|
||||
+3
-10
@@ -9,20 +9,14 @@ import com.intellij.openapi.progress.ProcessCanceledException
|
||||
import com.intellij.openapi.project.Project
|
||||
import org.jetbrains.kotlin.descriptors.SourceElement
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclaration
|
||||
import org.jetbrains.kotlin.fir.declarations.FirRegularClass
|
||||
import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction
|
||||
import org.jetbrains.kotlin.fir.declarations.FirVariable
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirSimpleFunctionImpl
|
||||
import org.jetbrains.kotlin.fir.deserialization.FirConstDeserializer
|
||||
import org.jetbrains.kotlin.fir.deserialization.FirDeserializationContext
|
||||
import org.jetbrains.kotlin.fir.deserialization.deserializeClassToSymbol
|
||||
import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic
|
||||
import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirClassReferenceExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.buildUnaryArgumentList
|
||||
import org.jetbrains.kotlin.fir.expressions.*
|
||||
import org.jetbrains.kotlin.fir.expressions.builder.*
|
||||
import org.jetbrains.kotlin.fir.java.JavaSymbolProvider
|
||||
import org.jetbrains.kotlin.fir.java.createConstant
|
||||
@@ -163,7 +157,6 @@ class KotlinDeserializedJvmSymbolsProvider(
|
||||
val ids = part.typeAliasNameIndex[classId.shortClassName]
|
||||
if (ids == null || ids.isEmpty()) return@firstNotNullResult null
|
||||
val aliasProto = ids.map { part.proto.getTypeAlias(it) }.single()
|
||||
|
||||
part.context.memberDeserializer.loadTypeAlias(aliasProto).symbol
|
||||
}
|
||||
}
|
||||
@@ -308,7 +301,7 @@ class KotlinDeserializedJvmSymbolsProvider(
|
||||
|
||||
private fun findAndDeserializeClass(
|
||||
classId: ClassId,
|
||||
parentContext: FirDeserializationContext? = null,
|
||||
parentContext: FirDeserializationContext? = null
|
||||
): FirRegularClassSymbol? {
|
||||
if (hasNoTopLevelClassOf(classId)) return null
|
||||
if (classesCache.containsKey(classId)) return classesCache[classId]
|
||||
|
||||
+13
-1
@@ -14,6 +14,7 @@ import org.jetbrains.kotlin.fir.declarations.builder.FirPrimaryConstructorBuilde
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.FirSimpleFunctionBuilder
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.buildValueParameter
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticProperty
|
||||
import org.jetbrains.kotlin.fir.declarations.synthetic.buildSyntheticProperty
|
||||
import org.jetbrains.kotlin.fir.expressions.FirConstKind
|
||||
@@ -35,6 +36,7 @@ import org.jetbrains.kotlin.load.java.typeEnhancement.*
|
||||
import org.jetbrains.kotlin.load.kotlin.SignatureBuildingComponents
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.utils.Jsr305State
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
class FirSignatureEnhancement(
|
||||
private val owner: FirRegularClass,
|
||||
@@ -98,6 +100,7 @@ class FirSignatureEnhancement(
|
||||
isVar = firElement.isVar
|
||||
isStatic = firElement.isStatic
|
||||
annotations += firElement.annotations
|
||||
status = firElement.status
|
||||
}
|
||||
return symbol
|
||||
}
|
||||
@@ -196,9 +199,18 @@ class FirSignatureEnhancement(
|
||||
if (firMethod.isPrimary) {
|
||||
FirPrimaryConstructorBuilder().apply {
|
||||
returnTypeRef = newReturnTypeRef
|
||||
status = FirDeclarationStatusImpl(firMethod.visibility, Modality.FINAL).apply {
|
||||
val resolvedStatus = firMethod.status.safeAs<FirResolvedDeclarationStatus>()
|
||||
status = if (resolvedStatus != null) {
|
||||
FirResolvedDeclarationStatusImpl(
|
||||
firMethod.visibility,
|
||||
Modality.FINAL
|
||||
)
|
||||
} else {
|
||||
FirDeclarationStatusImpl(firMethod.visibility, Modality.FINAL)
|
||||
}.apply {
|
||||
isExpect = false
|
||||
isActual = false
|
||||
isOverride = false
|
||||
isInner = firMethod.isInner
|
||||
}
|
||||
this.symbol = symbol
|
||||
|
||||
+1
@@ -127,6 +127,7 @@ class JavaClassUseSiteMemberScope(
|
||||
modality = firSimpleFunction.modality
|
||||
returnTypeRef = firSimpleFunction.returnTypeRef
|
||||
isStatic = firSimpleFunction.status.isStatic
|
||||
status = firSimpleFunction.status
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,10 +7,16 @@ package org.jetbrains.kotlin.fir
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
||||
import org.jetbrains.kotlin.fir.FirEffectiveVisibility.Permissiveness
|
||||
import org.jetbrains.kotlin.fir.declarations.FirClass
|
||||
import org.jetbrains.kotlin.fir.declarations.FirRegularClass
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclaration
|
||||
import org.jetbrains.kotlin.fir.declarations.FirMemberDeclaration
|
||||
import org.jetbrains.kotlin.fir.resolve.ScopeSession
|
||||
import org.jetbrains.kotlin.fir.resolve.effectiveVisibilityResolver
|
||||
import org.jetbrains.kotlin.fir.resolve.lookupSuperTypes
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassifierSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
|
||||
import org.jetbrains.kotlin.fir.types.classId
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
sealed class FirEffectiveVisibilityImpl(
|
||||
override val name: String,
|
||||
@@ -68,7 +74,7 @@ sealed class FirEffectiveVisibilityImpl(
|
||||
override fun lowerBound(other: FirEffectiveVisibility) = when (val o = other as FirEffectiveVisibilityImpl) {
|
||||
Public -> this
|
||||
Private, Local, InternalProtectedBound, is InternalOrPackage, is InternalProtected -> other
|
||||
is Protected -> InternalProtected(o.container)
|
||||
is Protected -> InternalProtected(o.containerSymbol, o.session)
|
||||
ProtectedBound -> InternalProtectedBound
|
||||
}
|
||||
}
|
||||
@@ -81,19 +87,22 @@ sealed class FirEffectiveVisibilityImpl(
|
||||
override fun toVisibility() = Visibilities.PRIVATE
|
||||
}
|
||||
|
||||
class Protected(val container: FirRegularClass?) : FirEffectiveVisibilityImpl("protected", publicApi = true) {
|
||||
class Protected(
|
||||
val containerSymbol: FirClassLikeSymbol<*>?,
|
||||
internal val session: FirSession
|
||||
) : FirEffectiveVisibilityImpl("protected", publicApi = true) {
|
||||
|
||||
override fun equals(other: Any?) = (other is Protected && container == other.container)
|
||||
override fun equals(other: Any?) = (other is Protected && containerSymbol == other.containerSymbol)
|
||||
|
||||
override fun hashCode() = container?.hashCode() ?: 0
|
||||
override fun hashCode() = containerSymbol?.hashCode() ?: 0
|
||||
|
||||
override fun toString() = "${super.toString()} (in ${container?.name ?: '?'})"
|
||||
override fun toString() = "${super.toString()} (in ${containerSymbol.safeAs<FirRegularClassSymbol>()?.fir?.name ?: '?'})"
|
||||
|
||||
override fun relation(other: FirEffectiveVisibility) = when (val o = other as FirEffectiveVisibilityImpl) {
|
||||
Public -> Permissiveness.LESS
|
||||
Private, Local, ProtectedBound, InternalProtectedBound -> Permissiveness.MORE
|
||||
is Protected -> containerRelation(container, o.container)
|
||||
is InternalProtected -> when (containerRelation(container, o.container)) {
|
||||
is Protected -> containerRelation(containerSymbol, o.containerSymbol, session)
|
||||
is InternalProtected -> when (containerRelation(containerSymbol, o.containerSymbol, session)) {
|
||||
// Protected never can be less permissive than internal & protected
|
||||
Permissiveness.SAME, Permissiveness.MORE -> Permissiveness.MORE
|
||||
Permissiveness.UNKNOWN, Permissiveness.LESS -> Permissiveness.UNKNOWN
|
||||
@@ -113,7 +122,7 @@ sealed class FirEffectiveVisibilityImpl(
|
||||
Permissiveness.LESS -> other
|
||||
else -> InternalProtectedBound
|
||||
}
|
||||
is InternalOrPackage -> InternalProtected(container)
|
||||
is InternalOrPackage -> InternalProtected(containerSymbol, session)
|
||||
}
|
||||
|
||||
override fun toVisibility() = Visibilities.PROTECTED
|
||||
@@ -138,19 +147,22 @@ sealed class FirEffectiveVisibilityImpl(
|
||||
}
|
||||
|
||||
// Lower bound for internal and protected(C)
|
||||
class InternalProtected(val container: FirRegularClass?) : FirEffectiveVisibilityImpl("internal & protected") {
|
||||
class InternalProtected(
|
||||
val containerSymbol: FirClassLikeSymbol<*>?,
|
||||
private val session: FirSession
|
||||
) : FirEffectiveVisibilityImpl("internal & protected") {
|
||||
|
||||
override fun equals(other: Any?) = (other is InternalProtected && container == other.container)
|
||||
override fun equals(other: Any?) = (other is InternalProtected && containerSymbol == other.containerSymbol)
|
||||
|
||||
override fun hashCode() = container?.hashCode() ?: 0
|
||||
override fun hashCode() = containerSymbol?.hashCode() ?: 0
|
||||
|
||||
override fun toString() = "${super.toString()} (in ${container?.name ?: '?'})"
|
||||
override fun toString() = "${super.toString()} (in ${containerSymbol.safeAs<FirRegularClassSymbol>()?.fir?.name ?: '?'})"
|
||||
|
||||
override fun relation(other: FirEffectiveVisibility) = when (val o = other as FirEffectiveVisibilityImpl) {
|
||||
Public, is InternalOrPackage -> Permissiveness.LESS
|
||||
Private, Local, InternalProtectedBound -> Permissiveness.MORE
|
||||
is InternalProtected -> containerRelation(container, o.container)
|
||||
is Protected -> when (containerRelation(container, o.container)) {
|
||||
is InternalProtected -> containerRelation(containerSymbol, o.containerSymbol, session)
|
||||
is Protected -> when (containerRelation(containerSymbol, o.containerSymbol, session)) {
|
||||
// Internal & protected never can be more permissive than just protected
|
||||
Permissiveness.SAME, Permissiveness.LESS -> Permissiveness.LESS
|
||||
Permissiveness.UNKNOWN, Permissiveness.MORE -> Permissiveness.UNKNOWN
|
||||
@@ -193,25 +205,30 @@ sealed class FirEffectiveVisibilityImpl(
|
||||
}
|
||||
|
||||
companion object {
|
||||
private fun containerRelation(first: FirRegularClass?, second: FirRegularClass?): Permissiveness =
|
||||
private fun containerRelation(first: FirClassLikeSymbol<*>?, second: FirClassLikeSymbol<*>?, session: FirSession): Permissiveness =
|
||||
if (first == null || second == null) {
|
||||
Permissiveness.UNKNOWN
|
||||
} else if (first == second) {
|
||||
Permissiveness.SAME
|
||||
} else {
|
||||
when {
|
||||
first.collectSupertypes().any { it.classId == second.symbol.classId } -> Permissiveness.LESS
|
||||
second.collectSupertypes().any { it.classId == first.symbol.classId } -> Permissiveness.MORE
|
||||
first.collectSupertypes(session).any { it.classId == second.classId } -> Permissiveness.LESS
|
||||
second.collectSupertypes(session).any { it.classId == first.classId } -> Permissiveness.MORE
|
||||
else -> Permissiveness.UNKNOWN
|
||||
}
|
||||
}
|
||||
|
||||
private fun FirRegularClass.collectSupertypes() = lookupSuperTypes(
|
||||
this as FirClass<*>,
|
||||
private fun FirClassifierSymbol<*>.collectSupertypes(session: FirSession) = lookupSuperTypes(
|
||||
this,
|
||||
lookupInterfaces = true,
|
||||
deep = true,
|
||||
useSiteSession = this.session
|
||||
useSiteSession = session
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun FirMemberDeclaration.getEffectiveVisibility(
|
||||
session: FirSession,
|
||||
containingDeclarations: List<FirDeclaration>,
|
||||
scopeSession: ScopeSession
|
||||
): FirEffectiveVisibility = session.effectiveVisibilityResolver.resolveFor(this, containingDeclarations, scopeSession)
|
||||
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.fir
|
||||
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.resolve.ScopeSession
|
||||
import org.jetbrains.kotlin.fir.resolve.firSymbolProvider
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
class FirEffectiveVisibilityResolverImpl(private val session: FirSession) : FirEffectiveVisibilityResolver {
|
||||
val cache = mutableMapOf<FirSourceElement, FirEffectiveVisibility>()
|
||||
|
||||
private fun FirElement.remember(effectiveVisibility: FirEffectiveVisibility): FirEffectiveVisibility {
|
||||
val source = source
|
||||
if (source != null) {
|
||||
cache[source] = effectiveVisibility
|
||||
}
|
||||
return effectiveVisibility
|
||||
}
|
||||
|
||||
override fun resolveFor(
|
||||
declaration: FirMemberDeclaration,
|
||||
containingDeclarations: List<FirDeclaration>?,
|
||||
scopeSession: ScopeSession
|
||||
): FirEffectiveVisibility {
|
||||
if (declaration.source != null) {
|
||||
cache[declaration.source]?.let {
|
||||
return it
|
||||
}
|
||||
}
|
||||
|
||||
val (parentSymbol, parentEffectiveVisibility) =
|
||||
declaration.getParentInfo(containingDeclarations, scopeSession)
|
||||
var visibility = declaration.visibility
|
||||
|
||||
// this is a temporary solution until
|
||||
// visibility starts to understand
|
||||
// overrides itself.
|
||||
if (declaration is FirSimpleFunction) {
|
||||
parentSymbol?.fir.safeAs<FirClass<*>>()?.let {
|
||||
visibility = declaration.lowestVisibilityAmongOverrides(it, session, scopeSession)
|
||||
}
|
||||
}
|
||||
|
||||
var selfEffectiveVisibility = visibility.firEffectiveVisibility(session, parentSymbol)
|
||||
selfEffectiveVisibility = parentEffectiveVisibility.lowerBound(selfEffectiveVisibility)
|
||||
return declaration.remember(selfEffectiveVisibility)
|
||||
}
|
||||
|
||||
private fun FirMemberDeclaration.getParentInfo(
|
||||
containingDeclarations: List<FirDeclaration>?,
|
||||
scopeSession: ScopeSession
|
||||
): Pair<FirClassLikeSymbol<*>?, FirEffectiveVisibility> {
|
||||
var parentEffectiveVisibility: FirEffectiveVisibility = FirEffectiveVisibilityImpl.Public
|
||||
// because for now effective visibility
|
||||
// only works with FirClassLikeSymbol's
|
||||
var parentSymbol: FirClassLikeSymbol<*>? = null
|
||||
val parentClassId = this.getParentClassId()
|
||||
|
||||
// for some reason ClassId for "/<anonymous>"
|
||||
// has local = false but still returns
|
||||
// null instead of a symbol
|
||||
// TODO: fix
|
||||
var succeededToGetSymbol = false
|
||||
|
||||
if (parentClassId?.isLocal == false) {
|
||||
parentSymbol = session.firSymbolProvider.getClassLikeSymbolByFqName(parentClassId)
|
||||
parentSymbol?.fir.safeAs<FirMemberDeclaration>()?.let {
|
||||
succeededToGetSymbol = true
|
||||
parentEffectiveVisibility = resolveFor(it, null, scopeSession)
|
||||
}
|
||||
}
|
||||
|
||||
// we suppose we can't ever get a local classId
|
||||
// of some fir from outside of our containing declarations
|
||||
if (!succeededToGetSymbol && parentClassId != null && containingDeclarations != null) {
|
||||
parentClassId.findOuterContainerInfo(containingDeclarations, scopeSession)?.let {
|
||||
parentSymbol = it.first
|
||||
parentEffectiveVisibility = it.second
|
||||
}
|
||||
}
|
||||
|
||||
return parentSymbol to parentEffectiveVisibility
|
||||
}
|
||||
|
||||
private fun FirDeclaration.getParentClassId(): ClassId? = when (this) {
|
||||
is FirCallableMemberDeclaration<*> -> this.symbol.callableId.classId
|
||||
is FirClassLikeDeclaration<*> -> this.symbol.classId.outerClassId
|
||||
else -> null
|
||||
}
|
||||
|
||||
private fun FirDeclaration.getClassId(): ClassId? = when (this) {
|
||||
is FirCallableMemberDeclaration<*> -> this.symbol.callableId.classId
|
||||
is FirClassLikeDeclaration<*> -> this.symbol.classId
|
||||
else -> null
|
||||
}
|
||||
|
||||
private fun ClassId.findOuterContainerInfo(
|
||||
containingDeclarations: List<FirDeclaration>,
|
||||
scopeSession: ScopeSession
|
||||
): Pair<FirClassLikeSymbol<*>, FirEffectiveVisibility>? {
|
||||
for (index in containingDeclarations.indices) {
|
||||
val declaration = containingDeclarations[index]
|
||||
val declarationClassId = declaration.getClassId()
|
||||
|
||||
// because classId's we take from firs are
|
||||
// not the same instances we find in containingDeclarations
|
||||
// TODO: fix
|
||||
if (this.asSingleFqName() == declarationClassId?.asSingleFqName()) {
|
||||
return when (declaration) {
|
||||
is FirRegularClass -> {
|
||||
declaration.symbol to resolveFor(declaration, containingDeclarations.subList(0, index), scopeSession)
|
||||
}
|
||||
is FirAnonymousObject -> {
|
||||
declaration.symbol to declaration.remember(FirEffectiveVisibilityImpl.Local)
|
||||
}
|
||||
else -> {
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
}
|
||||
@@ -14,9 +14,13 @@ import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.resolve.declaredMemberScopeProvider
|
||||
import org.jetbrains.kotlin.fir.resolve.firSymbolProvider
|
||||
import org.jetbrains.kotlin.fir.resolve.toSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
|
||||
import org.jetbrains.kotlin.fir.types.ConeClassLikeType
|
||||
import org.jetbrains.kotlin.fir.types.ConeKotlinType
|
||||
import org.jetbrains.kotlin.fir.types.ConeKotlinTypeProjection
|
||||
import org.jetbrains.kotlin.load.java.JavaVisibilities
|
||||
|
||||
fun firEffectiveVisibility(
|
||||
session: FirSession,
|
||||
@@ -31,21 +35,13 @@ fun FirRegularClass.firEffectiveVisibility(session: FirSession, checkPublishedAp
|
||||
fun Visibility.firEffectiveVisibility(session: FirSession, declaration: FirMemberDeclaration?): FirEffectiveVisibility =
|
||||
firEffectiveVisibility(session, normalize(), declaration)
|
||||
|
||||
fun ConeKotlinType.leastPermissiveDescriptor(session: FirSession, base: FirEffectiveVisibility): DeclarationWithRelation? =
|
||||
dependentDeclarations(session).leastPermissive(session, base)
|
||||
|
||||
fun FirMemberDeclaration.firEffectiveVisibility(
|
||||
session: FirSession, visibility: Visibility = this.visibility, checkPublishedApi: Boolean = false
|
||||
): FirEffectiveVisibility {
|
||||
val containing = this.containingClass(session)
|
||||
return lowerBound(
|
||||
visibility.firEffectiveVisibility(session, this),
|
||||
this.effectiveVisibility,
|
||||
containing?.firEffectiveVisibility(session, checkPublishedApi) ?: Public,
|
||||
containing?.effectiveVisibility ?: Public
|
||||
)
|
||||
fun Visibility.firEffectiveVisibility(session: FirSession, containerSymbol: FirClassLikeSymbol<*>?): FirEffectiveVisibility = when (this) {
|
||||
JavaVisibilities.PACKAGE_VISIBILITY -> forVisibility(session, containerSymbol)
|
||||
else -> normalize().forVisibility(session, containerSymbol)
|
||||
}
|
||||
|
||||
fun ConeKotlinType.leastPermissiveDescriptor(session: FirSession, base: FirEffectiveVisibility): DeclarationWithRelation? =
|
||||
dependentDeclarations(session).leastPermissive(session, base)
|
||||
|
||||
private fun lowerBound(vararg elements: FirEffectiveVisibility): FirEffectiveVisibility {
|
||||
if (elements.size < 2) {
|
||||
@@ -69,17 +65,32 @@ private fun FirMemberDeclaration.containingClass(session: FirSession): FirRegula
|
||||
?: (session.declaredMemberScopeProvider.getClassByClassId(classId) as? FirRegularClass)
|
||||
}
|
||||
|
||||
private fun FirClassLikeSymbol<*>.containingClass(session: FirSession): FirRegularClass? {
|
||||
val classId = when (this) {
|
||||
is FirRegularClassSymbol -> classId.outerClassId
|
||||
is FirCallableSymbol<*> -> callableId.classId
|
||||
else -> null
|
||||
} ?: return null
|
||||
if (classId.isLocal) return null
|
||||
return (session.firSymbolProvider.getClassLikeSymbolByFqName(classId)?.fir as? FirRegularClass)
|
||||
?: (session.declaredMemberScopeProvider.getClassByClassId(classId) as? FirRegularClass)
|
||||
}
|
||||
|
||||
private fun Visibility.forVisibility(session: FirSession, declaration: FirMemberDeclaration?) =
|
||||
forVisibility(session, declaration?.containingClass(session)?.symbol)
|
||||
|
||||
private fun Visibility.forVisibility(
|
||||
session: FirSession, declaration: FirMemberDeclaration?
|
||||
session: FirSession, containerSymbol: FirClassLikeSymbol<*>?
|
||||
): FirEffectiveVisibility =
|
||||
when (this) {
|
||||
Visibilities.PRIVATE, Visibilities.PRIVATE_TO_THIS, Visibilities.INVISIBLE_FAKE -> Private
|
||||
Visibilities.PROTECTED -> Protected(declaration?.containingClass(session))
|
||||
Visibilities.PROTECTED -> Protected(containerSymbol, session)
|
||||
Visibilities.INTERNAL -> Internal
|
||||
Visibilities.PUBLIC -> Public
|
||||
Visibilities.LOCAL -> Local
|
||||
// NB: visibility must be already normalized here, so e.g. no JavaVisibilities are possible at this point
|
||||
// TODO: else -> throw AssertionError("Visibility $name is not allowed in forVisibility")
|
||||
JavaVisibilities.PACKAGE_VISIBILITY -> PackagePrivate
|
||||
else -> Private
|
||||
}
|
||||
|
||||
|
||||
@@ -19,4 +19,5 @@ abstract class FirModuleBasedSession(
|
||||
fun FirModuleBasedSession.registerResolveComponents() {
|
||||
register(FirQualifierResolver::class, FirQualifierResolverImpl(this))
|
||||
register(FirTypeResolver::class, FirTypeResolverImpl(this))
|
||||
register(FirEffectiveVisibilityResolver::class, FirEffectiveVisibilityResolverImpl(this))
|
||||
}
|
||||
@@ -5,9 +5,46 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.resolve.ScopeSession
|
||||
import org.jetbrains.kotlin.fir.scopes.FirTypeScope
|
||||
import org.jetbrains.kotlin.fir.scopes.ProcessorAction
|
||||
import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope
|
||||
import org.jetbrains.kotlin.fir.types.ConeInferenceContext
|
||||
import org.jetbrains.kotlin.fir.types.ConeTypeCheckerContext
|
||||
import org.jetbrains.kotlin.fir.types.ConeTypeContext
|
||||
|
||||
val FirSession.typeContext: ConeInferenceContext
|
||||
get() = ConeTypeCheckerContext(isErrorTypeEqualsToAnything = false, isStubTypeEqualsToAnything = false, this)
|
||||
|
||||
/**
|
||||
* Returns the list of functions that overridden by given
|
||||
*/
|
||||
fun FirSimpleFunction.lowestVisibilityAmongOverrides(
|
||||
containingClass: FirClass<*>,
|
||||
session: FirSession,
|
||||
scopeSession: ScopeSession
|
||||
): Visibility {
|
||||
val firTypeScope = containingClass.unsubstitutedScope(session, scopeSession) as FirTypeScope
|
||||
var visibility = visibility
|
||||
|
||||
// required; otherwise processOverriddenFunctions()
|
||||
// will process nothing
|
||||
firTypeScope.processFunctionsByName(symbol.fir.name) { }
|
||||
|
||||
firTypeScope.processOverriddenFunctions(symbol) {
|
||||
val overriddenVisibility = when (val fir = it.fir) {
|
||||
is FirMemberDeclaration -> fir.visibility
|
||||
is FirPropertyAccessor -> fir.visibility
|
||||
else -> null
|
||||
}
|
||||
|
||||
overriddenVisibility?.let { that ->
|
||||
visibility = that
|
||||
}
|
||||
|
||||
ProcessorAction.NEXT
|
||||
}
|
||||
|
||||
return visibility
|
||||
}
|
||||
+10
-11
@@ -10,17 +10,13 @@ import org.jetbrains.kotlin.builtins.jvm.JvmBuiltInsSettings
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin
|
||||
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||
import org.jetbrains.kotlin.fir.declarations.addDeclarations
|
||||
import org.jetbrains.kotlin.fir.*
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.*
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||
import org.jetbrains.kotlin.fir.generateValueOfFunction
|
||||
import org.jetbrains.kotlin.fir.generateValuesFunction
|
||||
import org.jetbrains.kotlin.fir.resolve.providers.impl.FirCloneableSymbolProvider.Companion.CLONEABLE_CLASS_ID
|
||||
import org.jetbrains.kotlin.fir.resolve.providers.impl.FirCloneableSymbolProvider.Companion.CLONE
|
||||
import org.jetbrains.kotlin.fir.resolve.providers.impl.FirCloneableSymbolProvider.Companion.CLONEABLE_CLASS_ID
|
||||
import org.jetbrains.kotlin.fir.resolve.transformers.sealedInheritors
|
||||
import org.jetbrains.kotlin.fir.scopes.KotlinScopeProvider
|
||||
import org.jetbrains.kotlin.fir.symbols.CallableId
|
||||
@@ -61,7 +57,7 @@ fun deserializeClassToSymbol(
|
||||
val flags = classProto.flags
|
||||
val kind = Flags.CLASS_KIND.get(flags)
|
||||
val modality = ProtoEnumFlags.modality(Flags.MODALITY.get(flags))
|
||||
val status = FirDeclarationStatusImpl(
|
||||
val status = FirResolvedDeclarationStatusImpl(
|
||||
ProtoEnumFlags.visibility(Flags.VISIBILITY.get(flags)),
|
||||
modality
|
||||
).apply {
|
||||
@@ -157,7 +153,10 @@ fun deserializeClassToSymbol(
|
||||
returnTypeRef = buildResolvedTypeRef { type = enumType }
|
||||
name = enumEntryName
|
||||
this.symbol = FirVariableSymbol(CallableId(classId, enumEntryName))
|
||||
this.status = FirDeclarationStatusImpl(Visibilities.PUBLIC, Modality.FINAL).apply {
|
||||
this.status = FirResolvedDeclarationStatusImpl(
|
||||
Visibilities.PUBLIC,
|
||||
Modality.FINAL
|
||||
).apply {
|
||||
isStatic = true
|
||||
}
|
||||
resolvePhase = FirResolvePhase.ANALYZED_DEPENDENCIES
|
||||
@@ -241,7 +240,7 @@ private fun FirRegularClassBuilder.addCloneForArrayIfNeeded(classId: ClassId) {
|
||||
isNullable = false
|
||||
)
|
||||
}
|
||||
status = FirDeclarationStatusImpl(Visibilities.PUBLIC, Modality.FINAL).apply {
|
||||
status = FirResolvedDeclarationStatusImpl(Visibilities.PUBLIC, Modality.FINAL).apply {
|
||||
isOverride = true
|
||||
}
|
||||
name = CLONE
|
||||
|
||||
+35
-13
@@ -161,15 +161,19 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
||||
val flags = proto.flags
|
||||
val name = c.nameResolver.getName(proto.name)
|
||||
val local = c.childContext(proto.typeParameterList)
|
||||
val classId = ClassId(c.packageFqName, name)
|
||||
return buildTypeAlias {
|
||||
session = c.session
|
||||
origin = FirDeclarationOrigin.Library
|
||||
this.name = name
|
||||
status = FirDeclarationStatusImpl(ProtoEnumFlags.visibility(Flags.VISIBILITY.get(flags)), Modality.FINAL).apply {
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
ProtoEnumFlags.visibility(Flags.VISIBILITY.get(flags)),
|
||||
Modality.FINAL
|
||||
).apply {
|
||||
isExpect = Flags.IS_EXPECT_CLASS.get(flags)
|
||||
isActual = false
|
||||
}
|
||||
symbol = FirTypeAliasSymbol(ClassId(c.packageFqName, name))
|
||||
symbol = FirTypeAliasSymbol(classId)
|
||||
expandedTypeRef = buildResolvedTypeRef {
|
||||
type = local.typeDeserializer.type(proto.underlyingType(c.typeTable), ConeAttributes.Empty)
|
||||
}
|
||||
@@ -178,10 +182,14 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
||||
}
|
||||
}
|
||||
|
||||
fun loadProperty(proto: ProtoBuf.Property, classProto: ProtoBuf.Class? = null): FirProperty {
|
||||
fun loadProperty(
|
||||
proto: ProtoBuf.Property,
|
||||
classProto: ProtoBuf.Class? = null
|
||||
): FirProperty {
|
||||
val flags = if (proto.hasFlags()) proto.flags else loadOldFlags(proto.oldFlags)
|
||||
val callableName = c.nameResolver.getName(proto.name)
|
||||
val symbol = FirPropertySymbol(CallableId(c.packageFqName, c.relativeClassName, callableName))
|
||||
val callableId = CallableId(c.packageFqName, c.relativeClassName, callableName)
|
||||
val symbol = FirPropertySymbol(callableId)
|
||||
val local = c.childContext(proto.typeParameterList)
|
||||
|
||||
// Per documentation on Property.getter_flags in metadata.proto, if an accessor flags field is absent, its value should be computed
|
||||
@@ -214,7 +222,7 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
||||
origin = FirDeclarationOrigin.Library
|
||||
this.returnTypeRef = returnTypeRef
|
||||
isGetter = true
|
||||
status = FirDeclarationStatusImpl(visibility, modality)
|
||||
status = FirResolvedDeclarationStatusImpl(visibility, modality)
|
||||
annotations +=
|
||||
c.annotationDeserializer.loadPropertyGetterAnnotations(
|
||||
c.containerSource, proto, local.nameResolver, local.typeTable, getterFlags
|
||||
@@ -238,7 +246,7 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
||||
origin = FirDeclarationOrigin.Library
|
||||
this.returnTypeRef = FirImplicitUnitTypeRef(source)
|
||||
isGetter = false
|
||||
status = FirDeclarationStatusImpl(visibility, modality)
|
||||
status = FirResolvedDeclarationStatusImpl(visibility, modality)
|
||||
annotations +=
|
||||
c.annotationDeserializer.loadPropertySetterAnnotations(
|
||||
c.containerSource, proto, local.nameResolver, local.typeTable, setterFlags
|
||||
@@ -270,7 +278,7 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
||||
this.isVar = isVar
|
||||
this.symbol = symbol
|
||||
isLocal = false
|
||||
status = FirDeclarationStatusImpl(
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
ProtoEnumFlags.visibility(Flags.VISIBILITY.get(flags)),
|
||||
ProtoEnumFlags.modality(Flags.MODALITY.get(flags))
|
||||
).apply {
|
||||
@@ -300,7 +308,10 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
||||
}
|
||||
}
|
||||
|
||||
fun loadFunction(proto: ProtoBuf.Function, classProto: ProtoBuf.Class? = null): FirSimpleFunction {
|
||||
fun loadFunction(
|
||||
proto: ProtoBuf.Function,
|
||||
classProto: ProtoBuf.Class? = null
|
||||
): FirSimpleFunction {
|
||||
val flags = if (proto.hasFlags()) proto.flags else loadOldFlags(proto.oldFlags)
|
||||
|
||||
val receiverAnnotations = if (proto.hasReceiver()) {
|
||||
@@ -316,7 +327,8 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
||||
c.versionRequirementTable
|
||||
|
||||
val callableName = c.nameResolver.getName(proto.name)
|
||||
val symbol = FirNamedFunctionSymbol(CallableId(c.packageFqName, c.relativeClassName, callableName))
|
||||
val callableId = CallableId(c.packageFqName, c.relativeClassName, callableName)
|
||||
val symbol = FirNamedFunctionSymbol(callableId)
|
||||
val local = c.childContext(proto.typeParameterList)
|
||||
// TODO: support contracts
|
||||
|
||||
@@ -328,7 +340,7 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
||||
annotations += receiverAnnotations
|
||||
}
|
||||
name = callableName
|
||||
status = FirDeclarationStatusImpl(
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
ProtoEnumFlags.visibility(Flags.VISIBILITY.get(flags)),
|
||||
ProtoEnumFlags.modality(Flags.MODALITY.get(flags))
|
||||
).apply {
|
||||
@@ -364,10 +376,15 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
||||
return simpleFunction
|
||||
}
|
||||
|
||||
fun loadConstructor(proto: ProtoBuf.Constructor, classProto: ProtoBuf.Class, classBuilder: FirRegularClassBuilder): FirConstructor {
|
||||
fun loadConstructor(
|
||||
proto: ProtoBuf.Constructor,
|
||||
classProto: ProtoBuf.Class,
|
||||
classBuilder: FirRegularClassBuilder
|
||||
): FirConstructor {
|
||||
val flags = proto.flags
|
||||
val relativeClassName = c.relativeClassName!!
|
||||
val symbol = FirConstructorSymbol(CallableId(c.packageFqName, relativeClassName, relativeClassName.shortName()))
|
||||
val callableId = CallableId(c.packageFqName, relativeClassName, relativeClassName.shortName())
|
||||
val symbol = FirConstructorSymbol(callableId)
|
||||
val local = c.childContext(emptyList())
|
||||
val isPrimary = !Flags.IS_SECONDARY.get(flags)
|
||||
|
||||
@@ -389,9 +406,14 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
||||
session = c.session
|
||||
origin = FirDeclarationOrigin.Library
|
||||
returnTypeRef = delegatedSelfType
|
||||
status = FirDeclarationStatusImpl(ProtoEnumFlags.visibility(Flags.VISIBILITY.get(flags)), Modality.FINAL).apply {
|
||||
val visibility = ProtoEnumFlags.visibility(Flags.VISIBILITY.get(flags))
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
visibility,
|
||||
Modality.FINAL
|
||||
).apply {
|
||||
isExpect = Flags.IS_EXPECT_FUNCTION.get(flags)
|
||||
isActual = false
|
||||
isOverride = false
|
||||
isInner = classBuilder.status.isInner
|
||||
}
|
||||
this.symbol = symbol
|
||||
|
||||
@@ -62,6 +62,7 @@ val FirSession.correspondingSupertypesCache: FirCorrespondingSupertypesCache by
|
||||
val FirSession.declaredMemberScopeProvider: FirDeclaredMemberScopeProvider by FirSession.sessionComponentAccessor()
|
||||
val FirSession.qualifierResolver: FirQualifierResolver by FirSession.sessionComponentAccessor()
|
||||
val FirSession.typeResolver: FirTypeResolver by FirSession.sessionComponentAccessor()
|
||||
val FirSession.effectiveVisibilityResolver: FirEffectiveVisibilityResolver by FirSession.sessionComponentAccessor()
|
||||
|
||||
fun ConeClassLikeLookupTag.toSymbol(useSiteSession: FirSession): FirClassLikeSymbol<*>? {
|
||||
if (this is ConeClassLookupTagWithFixedSymbol) {
|
||||
|
||||
@@ -42,6 +42,18 @@ fun lookupSuperTypes(
|
||||
}
|
||||
}
|
||||
|
||||
fun lookupSuperTypes(
|
||||
symbol: FirClassifierSymbol<*>,
|
||||
lookupInterfaces: Boolean,
|
||||
deep: Boolean,
|
||||
useSiteSession: FirSession,
|
||||
supertypeSupplier: SupertypeSupplier = SupertypeSupplier.Default
|
||||
): List<ConeClassLikeType> {
|
||||
return mutableListOf<ConeClassLikeType>().also {
|
||||
symbol.collectSuperTypes(it, mutableSetOf(), deep, lookupInterfaces, false, useSiteSession, supertypeSupplier)
|
||||
}
|
||||
}
|
||||
|
||||
inline fun <reified ID : Any, reified FS : FirScope> scopeSessionKey(): ScopeSessionKey<ID, FS> {
|
||||
return object : ScopeSessionKey<ID, FS>() {}
|
||||
}
|
||||
|
||||
+11
-5
@@ -11,19 +11,19 @@ import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.SourceElement
|
||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.*
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.buildRegularClass
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.buildSimpleFunction
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.buildTypeParameter
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.buildValueParameter
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.deserialization.FirBuiltinAnnotationDeserializer
|
||||
import org.jetbrains.kotlin.fir.deserialization.FirConstDeserializer
|
||||
import org.jetbrains.kotlin.fir.deserialization.FirDeserializationContext
|
||||
import org.jetbrains.kotlin.fir.deserialization.deserializeClassToSymbol
|
||||
import org.jetbrains.kotlin.fir.resolve.providers.FirSymbolProvider
|
||||
import org.jetbrains.kotlin.fir.resolve.getOrPut
|
||||
import org.jetbrains.kotlin.fir.resolve.providers.FirSymbolProvider
|
||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||
import org.jetbrains.kotlin.fir.scopes.KotlinScopeProvider
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.nestedClassifierScope
|
||||
@@ -90,7 +90,10 @@ class FirBuiltinSymbolProvider(val session: FirSession, val kotlinScopeProvider:
|
||||
session = this@FirBuiltinSymbolProvider.session
|
||||
origin = FirDeclarationOrigin.Synthetic
|
||||
name = relativeClassName.shortName()
|
||||
status = FirDeclarationStatusImpl(Visibilities.PUBLIC, Modality.ABSTRACT).apply {
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
Visibilities.PUBLIC,
|
||||
Modality.ABSTRACT
|
||||
).apply {
|
||||
isExpect = false
|
||||
isActual = false
|
||||
isInner = false
|
||||
@@ -127,7 +130,10 @@ class FirBuiltinSymbolProvider(val session: FirSession, val kotlinScopeProvider:
|
||||
},
|
||||
)
|
||||
val name = OperatorNameConventions.INVOKE
|
||||
val functionStatus = FirDeclarationStatusImpl(Visibilities.PUBLIC, Modality.ABSTRACT).apply {
|
||||
val functionStatus = FirResolvedDeclarationStatusImpl(
|
||||
Visibilities.PUBLIC,
|
||||
Modality.ABSTRACT
|
||||
).apply {
|
||||
isExpect = false
|
||||
isActual = false
|
||||
isOverride = false
|
||||
|
||||
+4
-16
@@ -20,7 +20,8 @@ import org.jetbrains.kotlin.fir.visitors.compose
|
||||
import org.jetbrains.kotlin.fir.visitors.transformSingle
|
||||
|
||||
@OptIn(AdapterForResolveProcessor::class)
|
||||
class FirStatusResolveProcessor(session: FirSession, scopeSession: ScopeSession) : FirTransformerBasedResolveProcessor(session, scopeSession) {
|
||||
class FirStatusResolveProcessor(session: FirSession, scopeSession: ScopeSession) :
|
||||
FirTransformerBasedResolveProcessor(session, scopeSession) {
|
||||
override val transformer = FirStatusResolveTransformer(session)
|
||||
}
|
||||
|
||||
@@ -170,13 +171,6 @@ class FirStatusResolveTransformer(
|
||||
}
|
||||
}
|
||||
|
||||
private val <F : FirClass<F>> FirClass<F>.effectiveVisibility: FirEffectiveVisibility
|
||||
get() = when (this) {
|
||||
is FirRegularClass -> status.effectiveVisibility
|
||||
is FirAnonymousObject -> FirEffectiveVisibilityImpl.Local
|
||||
else -> error("Unknown kind of class: ${this::class}")
|
||||
}
|
||||
|
||||
private val <F : FirClass<F>> FirClass<F>.modality: Modality?
|
||||
get() = when (this) {
|
||||
is FirRegularClass -> status.modality
|
||||
@@ -189,9 +183,7 @@ fun FirDeclaration.resolveStatus(
|
||||
containingClass: FirClass<*>?,
|
||||
isLocal: Boolean
|
||||
): FirDeclarationStatus {
|
||||
if (status.visibility == Visibilities.UNKNOWN || status.modality == null ||
|
||||
status.effectiveVisibility == FirEffectiveVisibility.Default
|
||||
) {
|
||||
if (status.visibility == Visibilities.UNKNOWN || status.modality == null) {
|
||||
val visibility = when (status.visibility) {
|
||||
Visibilities.UNKNOWN -> when {
|
||||
isLocal -> Visibilities.LOCAL
|
||||
@@ -201,11 +193,7 @@ fun FirDeclaration.resolveStatus(
|
||||
else -> status.visibility
|
||||
}
|
||||
val modality = status.modality ?: resolveModality(containingClass)
|
||||
val containerEffectiveVisibility = containingClass?.effectiveVisibility?.takeIf { it !is FirEffectiveVisibility.Default }
|
||||
?: FirEffectiveVisibilityImpl.Public
|
||||
val effectiveVisibility =
|
||||
visibility.firEffectiveVisibility(session, this as? FirMemberDeclaration).lowerBound(containerEffectiveVisibility)
|
||||
return (status as FirDeclarationStatusImpl).resolved(visibility, effectiveVisibility, modality)
|
||||
return (status as FirDeclarationStatusImpl).resolved(visibility, modality)
|
||||
}
|
||||
return status
|
||||
}
|
||||
|
||||
+4
-16
@@ -6,12 +6,9 @@
|
||||
package org.jetbrains.kotlin.fir.scopes.impl
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
||||
import org.jetbrains.kotlin.fir.FirEffectiveVisibilityImpl
|
||||
import org.jetbrains.kotlin.fir.FirFakeSourceElementKind
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.*
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.*
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticProperty
|
||||
import org.jetbrains.kotlin.fir.declarations.synthetic.buildSyntheticProperty
|
||||
@@ -342,19 +339,11 @@ class FirClassSubstitutionScope(
|
||||
}
|
||||
}
|
||||
|
||||
private fun FirDeclarationStatus.withLocalEffectiveVisibility(isLocal: Boolean): FirDeclarationStatus {
|
||||
return if (isLocal && this is FirDeclarationStatusImpl) {
|
||||
resolved(visibility, FirEffectiveVisibilityImpl.Local, modality!!)
|
||||
} else {
|
||||
this
|
||||
}
|
||||
}
|
||||
|
||||
private fun FirDeclarationStatus.withExpect(isExpect: Boolean): FirDeclarationStatus {
|
||||
return if (this.isExpect == isExpect) {
|
||||
this
|
||||
} else {
|
||||
FirResolvedDeclarationStatusImpl(visibility, effectiveVisibility, modality!!).apply {
|
||||
FirResolvedDeclarationStatusImpl(visibility, modality!!).apply {
|
||||
this.isExpect = isExpect
|
||||
}
|
||||
}
|
||||
@@ -372,7 +361,6 @@ class FirClassSubstitutionScope(
|
||||
): FirSimpleFunction {
|
||||
// TODO: consider using here some light-weight functions instead of pseudo-real FirMemberFunctionImpl
|
||||
// As second alternative, we can invent some light-weight kind of FirRegularClass
|
||||
val isLocal = fakeOverrideSymbol.callableId.classId?.isLocal == true
|
||||
return buildSimpleFunction {
|
||||
source = baseFunction.source
|
||||
this.session = session
|
||||
@@ -380,7 +368,7 @@ class FirClassSubstitutionScope(
|
||||
returnTypeRef = baseFunction.returnTypeRef.withReplacedReturnType(newReturnType)
|
||||
receiverTypeRef = baseFunction.receiverTypeRef?.withReplacedConeType(newReceiverType)
|
||||
name = baseFunction.name
|
||||
status = baseFunction.status.withLocalEffectiveVisibility(isLocal).withExpect(isExpect)
|
||||
status = baseFunction.status.withExpect(isExpect)
|
||||
symbol = fakeOverrideSymbol
|
||||
resolvePhase = baseFunction.resolvePhase
|
||||
configureAnnotationsAndParameters(session, baseFunction, newParameterTypes)
|
||||
@@ -440,7 +428,7 @@ class FirClassSubstitutionScope(
|
||||
isVar = baseProperty.isVar
|
||||
this.symbol = symbol
|
||||
isLocal = false
|
||||
status = baseProperty.status.withLocalEffectiveVisibility(isLocal).withExpect(isExpect)
|
||||
status = baseProperty.status.withExpect(isExpect)
|
||||
resolvePhase = baseProperty.resolvePhase
|
||||
annotations += baseProperty.annotations
|
||||
if (newTypeParameters != null) {
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ class FirIntegerLiteralTypeScope(private val session: FirSession, val isUnsigned
|
||||
FirILTTypeRefPlaceHolder(isUnsigned),
|
||||
receiverTypeRef = null,
|
||||
ALL_OPERATORS.getValue(name),
|
||||
FirResolvedDeclarationStatusImpl(Visibilities.PUBLIC, FirEffectiveVisibilityImpl.Public, Modality.FINAL),
|
||||
FirResolvedDeclarationStatusImpl(Visibilities.PUBLIC, Modality.FINAL),
|
||||
symbol
|
||||
).apply {
|
||||
resolvePhase = FirResolvePhase.BODY_RESOLVE
|
||||
|
||||
@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.fir.declarations
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.fir.FirEffectiveVisibility
|
||||
import org.jetbrains.kotlin.fir.FirElement
|
||||
import org.jetbrains.kotlin.fir.FirSourceElement
|
||||
import org.jetbrains.kotlin.fir.visitors.*
|
||||
@@ -20,7 +19,6 @@ import org.jetbrains.kotlin.fir.visitors.*
|
||||
interface FirDeclarationStatus : FirElement {
|
||||
override val source: FirSourceElement?
|
||||
val visibility: Visibility
|
||||
val effectiveVisibility: FirEffectiveVisibility
|
||||
val modality: Modality?
|
||||
val isExpect: Boolean
|
||||
val isActual: Boolean
|
||||
|
||||
-2
@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.fir.declarations
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.fir.FirEffectiveVisibility
|
||||
import org.jetbrains.kotlin.fir.FirSourceElement
|
||||
import org.jetbrains.kotlin.fir.visitors.*
|
||||
|
||||
@@ -19,7 +18,6 @@ import org.jetbrains.kotlin.fir.visitors.*
|
||||
interface FirResolvedDeclarationStatus : FirDeclarationStatus {
|
||||
override val source: FirSourceElement?
|
||||
override val visibility: Visibility
|
||||
override val effectiveVisibility: FirEffectiveVisibility
|
||||
override val modality: Modality?
|
||||
override val isExpect: Boolean
|
||||
override val isActual: Boolean
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.fir
|
||||
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclaration
|
||||
import org.jetbrains.kotlin.fir.declarations.FirMemberDeclaration
|
||||
import org.jetbrains.kotlin.fir.resolve.ScopeSession
|
||||
|
||||
interface FirEffectiveVisibilityResolver : FirSessionComponent {
|
||||
fun resolveFor(
|
||||
declaration: FirMemberDeclaration,
|
||||
containingDeclarations: List<FirDeclaration>?,
|
||||
scopeSession: ScopeSession
|
||||
): FirEffectiveVisibility
|
||||
}
|
||||
@@ -215,7 +215,9 @@ class FirRenderer(builder: StringBuilder, private val mode: RenderMode = RenderM
|
||||
override fun visitMemberDeclaration(memberDeclaration: FirMemberDeclaration) {
|
||||
memberDeclaration.annotations.renderAnnotations()
|
||||
if (memberDeclaration !is FirProperty || !memberDeclaration.isLocal) {
|
||||
print(memberDeclaration.visibility.asString(memberDeclaration.effectiveVisibility) + " ")
|
||||
// we can't access session.effectiveVisibilityResolver from here!
|
||||
// print(memberDeclaration.visibility.asString(memberDeclaration.getEffectiveVisibility(...)) + " ")
|
||||
print(memberDeclaration.visibility.asString() + " ")
|
||||
print(memberDeclaration.modalityAsString() + " ")
|
||||
}
|
||||
if (memberDeclaration.isExpect) {
|
||||
@@ -401,7 +403,9 @@ class FirRenderer(builder: StringBuilder, private val mode: RenderMode = RenderM
|
||||
|
||||
override fun visitConstructor(constructor: FirConstructor) {
|
||||
constructor.annotations.renderAnnotations()
|
||||
print(constructor.visibility.asString(constructor.effectiveVisibility) + " ")
|
||||
// we can't access session.effectiveVisibilityResolver from here!
|
||||
// print(constructor.visibility.asString(constructor.getEffectiveVisibility(...)) + " ")
|
||||
print(constructor.visibility.asString() + " ")
|
||||
if (constructor.isExpect) {
|
||||
print("expect ")
|
||||
}
|
||||
|
||||
@@ -14,8 +14,11 @@ import org.jetbrains.kotlin.fir.declarations.impl.FirRegularClassImpl
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirAnonymousObjectSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.ConeClassLikeType
|
||||
import org.jetbrains.kotlin.fir.types.ConeFlexibleType
|
||||
import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef
|
||||
import org.jetbrains.kotlin.fir.types.classId
|
||||
import org.jetbrains.kotlin.fir.types.coneTypeSafe
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
|
||||
fun FirTypeParameterBuilder.addDefaultBoundIfNecessary(isFlexible: Boolean = false) {
|
||||
@@ -41,7 +44,6 @@ inline val FirMemberDeclaration.modality get() = status.modality
|
||||
inline val FirMemberDeclaration.visibility get() = status.visibility
|
||||
inline val FirMemberDeclaration.allowsToHaveFakeOverride: Boolean
|
||||
get() = !Visibilities.isPrivate(visibility) && visibility != Visibilities.INVISIBLE_FAKE
|
||||
inline val FirMemberDeclaration.effectiveVisibility get() = status.effectiveVisibility
|
||||
inline val FirMemberDeclaration.isActual get() = status.isActual
|
||||
inline val FirMemberDeclaration.isExpect get() = status.isExpect
|
||||
inline val FirMemberDeclaration.isInner get() = status.isInner
|
||||
|
||||
+2
-4
@@ -20,8 +20,6 @@ open class FirDeclarationStatusImpl(
|
||||
override val modality: Modality?
|
||||
) : FirPureAbstractElement(), FirDeclarationStatus {
|
||||
override val source: FirSourceElement? get() = null
|
||||
override val effectiveVisibility: FirEffectiveVisibility
|
||||
get() = FirEffectiveVisibility.Default
|
||||
protected var flags: Int = 0
|
||||
|
||||
private operator fun get(modifier: Modifier): Boolean = (flags and modifier.mask) != 0
|
||||
@@ -169,7 +167,7 @@ open class FirDeclarationStatusImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
fun resolved(visibility: Visibility, effectiveVisibility: FirEffectiveVisibility, modality: Modality): FirDeclarationStatus {
|
||||
return FirResolvedDeclarationStatusImpl(visibility, effectiveVisibility, modality, flags)
|
||||
fun resolved(visibility: Visibility, modality: Modality): FirDeclarationStatus {
|
||||
return FirResolvedDeclarationStatusImpl(visibility, modality, flags)
|
||||
}
|
||||
}
|
||||
+1
-3
@@ -12,16 +12,14 @@ import org.jetbrains.kotlin.fir.declarations.FirResolvedDeclarationStatus
|
||||
|
||||
class FirResolvedDeclarationStatusImpl(
|
||||
visibility: Visibility,
|
||||
override var effectiveVisibility: FirEffectiveVisibility,
|
||||
modality: Modality
|
||||
) : FirDeclarationStatusImpl(visibility, modality), FirResolvedDeclarationStatus {
|
||||
|
||||
internal constructor(
|
||||
visibility: Visibility,
|
||||
effectiveVisibility: FirEffectiveVisibility,
|
||||
modality: Modality,
|
||||
flags: Int
|
||||
) : this(visibility, effectiveVisibility, modality) {
|
||||
) : this(visibility, modality) {
|
||||
this.flags = flags
|
||||
}
|
||||
|
||||
|
||||
-1
@@ -329,7 +329,6 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
|
||||
declarationStatus.configure {
|
||||
+visibility
|
||||
+effectiveVisibility
|
||||
+modality
|
||||
generateBooleanFields(
|
||||
"expect", "actual", "override", "operator", "infix", "inline", "tailRec",
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ interface A extends C {
|
||||
|
||||
// FILE: B.kt
|
||||
|
||||
interface B : A {
|
||||
interface B : <!EXPOSED_SUPER_INTERFACE!>A<!> {
|
||||
fun bar()
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,6 @@ class J extends K {
|
||||
|
||||
// FILE: K.kt
|
||||
|
||||
class K : J() {
|
||||
class K : <!EXPOSED_SUPER_CLASS!>J<!>() {
|
||||
fun bar() {}
|
||||
}
|
||||
|
||||
+1
-1
@@ -12,6 +12,6 @@ class J extends I {
|
||||
|
||||
// FILE: K.kt
|
||||
|
||||
open class K : J() {
|
||||
open class K : <!EXPOSED_SUPER_CLASS!>J<!>() {
|
||||
fun baz() {}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// FILE: ExceptionTracker.kt
|
||||
|
||||
interface ExceptionTracker : LockBasedStorageManager.ExceptionHandlingStrategy {
|
||||
interface ExceptionTracker : <!EXPOSED_SUPER_INTERFACE!>LockBasedStorageManager.ExceptionHandlingStrategy<!> {
|
||||
}
|
||||
|
||||
// FILE: StorageManager.kt
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
abstract class Outer {
|
||||
protected open class My
|
||||
// Both valid: same way protected
|
||||
protected class Your: My()
|
||||
abstract protected fun foo(my: My): Your
|
||||
}
|
||||
|
||||
class OuterDerived: Outer() {
|
||||
// valid, My has better visibility
|
||||
protected class His: Outer.My()
|
||||
// valid, My and Your have better visibility
|
||||
override fun <!EXPOSED_FUNCTION_RETURN_TYPE!>foo<!>(<!EXPOSED_PARAMETER_TYPE!>my: Outer.My<!>) = Outer.Your()
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
abstract class Outer {
|
||||
protected open class My
|
||||
// Both valid: same way protected
|
||||
|
||||
@@ -16,29 +16,29 @@ class MyJavaClass {
|
||||
//FILE:a.kt
|
||||
package a
|
||||
|
||||
val mc = MyJavaClass()
|
||||
val <!EXPOSED_PROPERTY_TYPE!>mc<!> = MyJavaClass()
|
||||
val x = MyJavaClass.staticMethod()
|
||||
val y = MyJavaClass.NestedClass.staticMethodOfNested()
|
||||
val z = MyJavaClass.NestedClass()
|
||||
val <!EXPOSED_PROPERTY_TYPE!>z<!> = MyJavaClass.NestedClass()
|
||||
|
||||
//FILE: b.kt
|
||||
package b
|
||||
|
||||
import a.MyJavaClass
|
||||
|
||||
val mc1 = <!HIDDEN!>MyJavaClass<!>()
|
||||
val <!EXPOSED_PROPERTY_TYPE!>mc1<!> = <!HIDDEN!>MyJavaClass<!>()
|
||||
|
||||
val x = MyJavaClass.<!HIDDEN!>staticMethod<!>()
|
||||
val y = MyJavaClass.NestedClass.<!HIDDEN!>staticMethodOfNested<!>()
|
||||
val z = MyJavaClass.<!HIDDEN!>NestedClass<!>()
|
||||
val <!EXPOSED_PROPERTY_TYPE!>z<!> = MyJavaClass.<!HIDDEN!>NestedClass<!>()
|
||||
|
||||
//FILE: c.kt
|
||||
package a.c
|
||||
|
||||
import a.MyJavaClass
|
||||
|
||||
val mc1 = <!HIDDEN!>MyJavaClass<!>()
|
||||
val <!EXPOSED_PROPERTY_TYPE!>mc1<!> = <!HIDDEN!>MyJavaClass<!>()
|
||||
|
||||
val x = MyJavaClass.<!HIDDEN!>staticMethod<!>()
|
||||
val y = MyJavaClass.NestedClass.<!HIDDEN!>staticMethodOfNested<!>()
|
||||
val z = MyJavaClass.<!HIDDEN!>NestedClass<!>()
|
||||
val <!EXPOSED_PROPERTY_TYPE!>z<!> = MyJavaClass.<!HIDDEN!>NestedClass<!>()
|
||||
|
||||
+2
-2
@@ -10,6 +10,6 @@ package kotlin.sequences
|
||||
import p.*
|
||||
|
||||
interface I {
|
||||
val v1: FilteringSequence
|
||||
val v2: IndexingSequence<String>
|
||||
val <!EXPOSED_PROPERTY_TYPE!>v1<!>: FilteringSequence
|
||||
val <!EXPOSED_PROPERTY_TYPE!>v2<!>: IndexingSequence<String>
|
||||
}
|
||||
|
||||
-3
@@ -42,7 +42,6 @@ class AllOpenNestedClassGenerator(session: FirSession) : FirDeclarationGeneratio
|
||||
origin = FirDeclarationOrigin.Plugin(key)
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
Visibilities.PRIVATE,
|
||||
FirEffectiveVisibilityImpl.Private,
|
||||
Modality.FINAL
|
||||
).apply {
|
||||
isInner = true
|
||||
@@ -68,7 +67,6 @@ class AllOpenNestedClassGenerator(session: FirSession) : FirDeclarationGeneratio
|
||||
}
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
Visibilities.PUBLIC,
|
||||
FirEffectiveVisibilityImpl.Public,
|
||||
Modality.FINAL
|
||||
)
|
||||
symbol = FirConstructorSymbol(CallableId(classId, classId.shortClassName))
|
||||
@@ -81,7 +79,6 @@ class AllOpenNestedClassGenerator(session: FirSession) : FirDeclarationGeneratio
|
||||
returnTypeRef = session.builtinTypes.intType
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
Visibilities.PUBLIC,
|
||||
FirEffectiveVisibilityImpl.Public,
|
||||
Modality.FINAL
|
||||
)
|
||||
name = Name.identifier("hello")
|
||||
|
||||
-1
@@ -39,7 +39,6 @@ class AllOpenRecursiveNestedClassGenerator(session: FirSession) : FirDeclaration
|
||||
origin = FirDeclarationOrigin.Plugin(key)
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
Visibilities.PUBLIC,
|
||||
FirEffectiveVisibilityImpl.Public,
|
||||
Modality.FINAL
|
||||
)
|
||||
classKind = ClassKind.CLASS
|
||||
|
||||
-2
@@ -38,7 +38,6 @@ class AllOpenTopLevelDeclarationsGenerator(session: FirSession) : FirDeclaration
|
||||
origin = FirDeclarationOrigin.Plugin(key)
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
Visibilities.PUBLIC,
|
||||
FirEffectiveVisibilityImpl.Public,
|
||||
Modality.FINAL
|
||||
)
|
||||
classKind = ClassKind.OBJECT
|
||||
@@ -58,7 +57,6 @@ class AllOpenTopLevelDeclarationsGenerator(session: FirSession) : FirDeclaration
|
||||
returnTypeRef = session.builtinTypes.intType
|
||||
status = FirResolvedDeclarationStatusImpl(
|
||||
Visibilities.PUBLIC,
|
||||
FirEffectiveVisibilityImpl.Public,
|
||||
Modality.FINAL
|
||||
)
|
||||
name = Name.identifier("hello")
|
||||
|
||||
Reference in New Issue
Block a user