[FIR] Support some approximation of effective visibility

This commit is contained in:
Mikhail Glukhikh
2020-03-18 18:04:00 +03:00
parent cb3a31af6e
commit 50a9313a5e
28 changed files with 480 additions and 81 deletions
@@ -18,7 +18,7 @@ FILE: propertiesAndInitBlocks.kt
}
local final class LocalClass : R|kotlin/Any| {
public constructor(): R|LocalClass| {
public[local] constructor(): R|LocalClass| {
super<R|kotlin/Any|>()
}
@@ -34,7 +34,7 @@ FILE: propertiesAndInitBlocks.kt
)
public get(): R|kotlin/Unit| {
local final class LocalClass : R|kotlin/Any| {
public constructor(): R|LocalClass| {
public[local] constructor(): R|LocalClass| {
super<R|kotlin/Any|>()
}
@@ -6,11 +6,11 @@ FILE: localClassAccessesContainingClass.kt
public final fun foo(): R|kotlin/Unit| {
local final class Local : R|kotlin/Any| {
public constructor(): R|Outer.Local| {
public[local] constructor(): R|Outer.Local| {
super<R|kotlin/Any|>()
}
public final fun bar(): R|kotlin/Unit| {
public[local] final fun bar(): R|kotlin/Unit| {
lval x: R|kotlin/String| = this@R|/Outer|.R|/Outer.y|
}
@@ -1,7 +1,7 @@
FILE: localConstructor.kt
public final fun test(): R|kotlin/Unit| {
local final class Local : R|kotlin/Any| {
public constructor(): R|Local| {
public[local] constructor(): R|Local| {
super<R|kotlin/Any|>()
}
@@ -12,11 +12,11 @@ FILE: localInnerClass.kt
}
local final inner class Derived : R|Foo| {
public constructor(x: R|kotlin/Int|): R|<anonymous>.Derived| {
public[local] constructor(x: R|kotlin/Int|): R|<anonymous>.Derived| {
super<R|kotlin/Any|>()
}
public final val x: R|kotlin/Int| = R|<local>/x|
public[local] final val x: R|kotlin/Int| = R|<local>/x|
public get(): R|kotlin/Int|
}
@@ -33,7 +33,7 @@ FILE: localObjects.kt
super<R|kotlin/Any|>()
}
public final fun foo(): R|kotlin/Unit| {
public[local] 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 constructor(): R|BaseLocal| {
public[local] constructor(): R|BaseLocal| {
super<R|Bar|>()
}
public final fun baz(): R|kotlin/Unit| {
public[local] 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 constructor(): R|DerivedLocal| {
public[local] constructor(): R|DerivedLocal| {
super<R|BaseLocal|>()
}
public final fun gau(): R|kotlin/Unit| {
public[local] 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 constructor(): R|Bar| {
public[local] constructor(): R|Bar| {
super<R|kotlin/Any|>()
}
public final val y: R|kotlin/String| = String()
public[local] final val y: R|kotlin/String| = String()
public get(): R|kotlin/String|
public final fun R|kotlin/Int|.bar(s: R|kotlin/String|): R|kotlin/Boolean| {
public[local] 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 final val R|kotlin/Boolean|.w: R|kotlin/Char|
public[local] final val R|kotlin/Boolean|.w: R|kotlin/Char|
public get(): R|kotlin/Char| {
^ Char( )
}
public final fun <T : R|Foo|> id(arg: R|T|): R|T| {
public[local] final fun <T : R|Foo|> id(arg: R|T|): R|T| {
^id R|<local>/arg|
}
@@ -5,28 +5,28 @@ FILE: nestedVisibility.kt
}
private final class PrivateNested : R|kotlin/Any| {
public constructor(): R|Outer.PrivateNested| {
public[private] constructor(): R|Outer.PrivateNested| {
super<R|kotlin/Any|>()
}
}
private final inner class PrivateInner : R|kotlin/Any| {
public constructor(): R|Outer.PrivateInner| {
public[private] constructor(): R|Outer.PrivateInner| {
super<R|kotlin/Any|>()
}
}
protected final class ProtectedNested : R|kotlin/Any| {
public constructor(): R|Outer.ProtectedNested| {
public[protected] constructor(): R|Outer.ProtectedNested| {
super<R|kotlin/Any|>()
}
}
protected final inner class ProtectedInner : R|kotlin/Any| {
public constructor(): R|Outer.ProtectedInner| {
public[protected] constructor(): R|Outer.ProtectedInner| {
super<R|kotlin/Any|>()
}
@@ -14,7 +14,7 @@ FILE: O.kt
}
private final class Derived : R|Base| {
public constructor(bar: R|kotlin/Int|): R|O.Derived| {
public[private] constructor(bar: R|kotlin/Int|): R|O.Derived| {
super<R|Base|>()
}
@@ -22,14 +22,14 @@ FILE: O.kt
private get(): R|kotlin/Int|
private final inner class Some : R|kotlin/Any| {
public constructor(z: R|kotlin/Boolean|): R|O.Derived.Some| {
public[private] constructor(z: R|kotlin/Boolean|): R|O.Derived.Some| {
super<R|kotlin/Any|>()
}
public final val z: R|kotlin/Boolean| = R|<local>/z|
public[private] final val z: R|kotlin/Boolean| = R|<local>/z|
public get(): R|kotlin/Boolean|
public final fun test(): R|kotlin/Unit| {
public[private] 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 constructor(): R|anonymous| {
@@ -58,7 +58,7 @@ FILE: O.kt
}
public final fun test(): R|kotlin/Unit| {
public[private] 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 constructor(): R|anonymous| {
@@ -2,26 +2,26 @@ FILE: first.kt
private final fun foo(): R|kotlin/Unit| {
}
private final class Private : R|kotlin/Any| {
public constructor(): R|Private| {
public[private] constructor(): R|Private| {
super<R|kotlin/Any|>()
}
private final fun bar(): R|kotlin/Unit| {
}
public final fun baz(): R|kotlin/Unit| {
public[private] 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|.<Inapplicable(HIDDEN): [/Private.NotCompanion.foo]>#()
}
public final inner class Inner : R|kotlin/Any| {
public constructor(): R|Private.Inner| {
public[private] final inner class Inner : R|kotlin/Any| {
public[private] constructor(): R|Private.Inner| {
super<R|kotlin/Any|>()
}
public final fun foo(): R|kotlin/Unit| {
public[private] final fun foo(): R|kotlin/Unit| {
this@R|/Private|.R|/Private.bar|()
this@R|/Private.Companion|.R|/Private.Companion.fromCompanion|()
Q|Private.NotCompanion|.<Inapplicable(HIDDEN): [/Private.NotCompanion.foo]>#()
@@ -30,18 +30,18 @@ FILE: first.kt
}
private final class Nested : R|kotlin/Any| {
public constructor(): R|Private.Nested| {
public[private] constructor(): R|Private.Nested| {
super<R|kotlin/Any|>()
}
public final fun foo(): R|kotlin/Unit| {
public[private] final fun foo(): R|kotlin/Unit| {
this@R|/Private.Companion|.R|/Private.Companion.fromCompanion|()
Q|Private.NotCompanion|.<Inapplicable(HIDDEN): [/Private.NotCompanion.foo]>#()
}
}
public final companion object Companion : R|kotlin/Any| {
public[private] final companion object Companion : R|kotlin/Any| {
private constructor(): R|Private.Companion| {
super<R|kotlin/Any|>()
}
@@ -51,7 +51,7 @@ FILE: first.kt
}
public final object NotCompanion : R|kotlin/Any| {
public[private] 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 constructor(): R|Local| {
public[local] constructor(): R|Local| {
super<R|kotlin/Any|>()
}
private final fun bar(): R|kotlin/Unit|
public final fun baz(): R|kotlin/Unit| {
public[local] final fun baz(): R|kotlin/Unit| {
R|/Local.bar|()
this@R|/Local|.R|/Local.Inner.Inner|()
}
local final inner class Inner : R|kotlin/Any| {
public constructor(): R|Local.Inner| {
public[local] constructor(): R|Local.Inner| {
super<R|kotlin/Any|>()
}
public final fun foo(): R|kotlin/Unit| {
public[local] final fun foo(): R|kotlin/Unit| {
R|/Local.bar|()
}
@@ -24,11 +24,11 @@ FILE: protectedVisibility.kt
}
protected open class Nested : R|kotlin/Any| {
public constructor(): R|Protected.Nested| {
public[protected (in different classes)] constructor(): R|Protected.Nested| {
super<R|kotlin/Any|>()
}
public final fun foo(): R|kotlin/Unit| {
public[protected (in different classes)] 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 final fun fromCompanion(): R|kotlin/Unit| {
public[protected] 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 constructor(): R|Derived.NestedDerived| {
public[private] constructor(): R|Derived.NestedDerived| {
super<R|Protected.Nested|>()
}
public final fun use(): R|kotlin/Unit| {
public[private] final fun use(): R|kotlin/Unit| {
this@R|/Derived.NestedDerived|.R|/Protected.Nested.bar|()
}
@@ -4,11 +4,11 @@ FILE: callableReferenceToLocalClass.kt
}
public final fun test_1(): R|kotlin/Unit| {
local final class Data : R|kotlin/Any| {
public constructor(x: R|kotlin/Int|): R|Data| {
public[local] constructor(x: R|kotlin/Int|): R|Data| {
super<R|kotlin/Any|>()
}
public final val x: R|kotlin/Int| = R|<local>/x|
public[local] final val x: R|kotlin/Int| = R|<local>/x|
public get(): R|kotlin/Int|
}
@@ -5,15 +5,15 @@ FILE: objectInnerClass.kt
}
local final inner class Child : R|ERROR CLASS: Symbol not found, for `Base`| {
public constructor(property: R|B|): R|<anonymous>.Child| {
public[local] constructor(property: R|B|): R|<anonymous>.Child| {
super<R|ERROR CLASS: Symbol not found, for `Base`|>(R|<local>/property|)
}
public final fun R|ERROR CLASS: Symbol not found, for `Base`|.zoo(): R|kotlin/Unit| {
public[local] final fun R|ERROR CLASS: Symbol not found, for `Base`|.zoo(): R|kotlin/Unit| {
lval x: <ERROR TYPE REF: Unresolved name: property> = <Unresolved name: property>#
}
public final fun foo(): R|kotlin/Unit| {
public[local] final fun foo(): R|kotlin/Unit| {
<Unresolved name: baseFun>#()
lval x: <ERROR TYPE REF: Unresolved name: property> = <Unresolved name: property>#
<Unresolved name: zoo>#()
@@ -31,14 +31,14 @@ FILE: objectInnerClass.kt
}
local open inner class Base : R|kotlin/Any| {
public constructor(property: R|B|): R|<anonymous>.Base| {
public[local] constructor(property: R|B|): R|<anonymous>.Base| {
super<R|kotlin/Any|>()
}
public final val property: R|B| = R|<local>/property|
public[local] final val property: R|B| = R|<local>/property|
public get(): R|B|
public final fun baseFun(): R|kotlin/Unit| {
public[local] final fun baseFun(): R|kotlin/Unit| {
}
}
@@ -130,15 +130,15 @@ FILE: objectInnerClass.kt
}
local final inner class Child : R|ERROR CLASS: Symbol not found, for `Base`| {
public constructor(property: R|B|): R|Case3.<anonymous>.Child| {
public[local] constructor(property: R|B|): R|Case3.<anonymous>.Child| {
super<R|ERROR CLASS: Symbol not found, for `Base`|>(R|<local>/property|)
}
public final fun R|ERROR CLASS: Symbol not found, for `Base`|.zoo(): R|kotlin/Unit| {
public[local] final fun R|ERROR CLASS: Symbol not found, for `Base`|.zoo(): R|kotlin/Unit| {
lval x: <ERROR TYPE REF: Unresolved name: property> = <Unresolved name: property>#
}
public final fun foo(): R|kotlin/Unit| {
public[local] final fun foo(): R|kotlin/Unit| {
<Unresolved name: baseFun>#()
lval x: <ERROR TYPE REF: Unresolved name: property> = <Unresolved name: property>#
this@R|/Case3.<anonymous>.Child|.R|/Case3.<anonymous>.Child.zoo|()
@@ -156,14 +156,14 @@ FILE: objectInnerClass.kt
}
local open inner class Base : R|kotlin/Any| {
public constructor(property: R|B|): R|Case3.<anonymous>.Base| {
public[local] constructor(property: R|B|): R|Case3.<anonymous>.Base| {
super<R|kotlin/Any|>()
}
public final val property: R|B| = R|<local>/property|
public[local] final val property: R|B| = R|<local>/property|
public get(): R|B|
public final fun baseFun(): R|kotlin/Unit| {
public[local] final fun baseFun(): R|kotlin/Unit| {
}
}
@@ -27,17 +27,17 @@ FILE: hashTableWithForEach.kt
}
private final class Entry<K, V> : R|kotlin/collections/MutableMap.MutableEntry<K, V>| {
public constructor<K, V>(key: R|K|, value: R|V|): R|SomeHashTable.Entry<K, V>| {
public[private] constructor<K, V>(key: R|K|, value: R|V|): R|SomeHashTable.Entry<K, V>| {
super<R|kotlin/Any|>()
}
public final override val key: R|K| = R|<local>/key|
public[private] final override val key: R|K| = R|<local>/key|
public get(): R|K|
public final override val value: R|V| = R|<local>/value|
public[private] final override val value: R|V| = R|<local>/value|
public get(): R|V|
public final override fun setValue(newValue: R|V|): R|V| {
public[private] final override fun setValue(newValue: R|V|): R|V| {
^setValue throw R|java/lang/UnsupportedOperationException.UnsupportedOperationException|()
}
@@ -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 constructor(): R|Local| {
public[local] constructor(): R|Local| {
super<R|kotlin/Any|>()
}