Allow to import private members if they are in the same file
#KT-7724 Fixed
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package test
|
||||
|
||||
import test.C.E1
|
||||
import test.A.B.*
|
||||
import test.Obj.CInObj.Tt
|
||||
import test.Obj.foo
|
||||
|
||||
private enum class C {
|
||||
E1
|
||||
}
|
||||
|
||||
class A {
|
||||
private class B {
|
||||
object C
|
||||
class D
|
||||
}
|
||||
|
||||
fun test() {
|
||||
C
|
||||
D()
|
||||
}
|
||||
}
|
||||
|
||||
private object Obj {
|
||||
private class CInObj {
|
||||
class Tt
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
Tt()
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
E1
|
||||
A().test()
|
||||
foo()
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package test
|
||||
|
||||
import test.TopLevelClass.NestedClass
|
||||
import test.TopLevelClass.NestedClass.InNested
|
||||
import test.TopLevelEnum.NestedEnum.NestedEntry
|
||||
import test.TopLevelObject.inObject
|
||||
import test.TopLevelEnum.E1
|
||||
|
||||
private class TopLevelClass {
|
||||
private class NestedClass {
|
||||
class InNested
|
||||
}
|
||||
|
||||
fun test() {
|
||||
InNested()
|
||||
}
|
||||
}
|
||||
|
||||
private enum class TopLevelEnum(private val e: NestedEnum) {
|
||||
E1(NestedEntry);
|
||||
|
||||
private enum class NestedEnum {
|
||||
NestedEntry;
|
||||
}
|
||||
}
|
||||
|
||||
private object TopLevelObject {
|
||||
fun inObject() {}
|
||||
}
|
||||
|
||||
fun testAccess() {
|
||||
<!INVISIBLE_MEMBER!>NestedClass<!>()
|
||||
E1
|
||||
<!INVISIBLE_MEMBER!>InNested<!>()
|
||||
<!INVISIBLE_MEMBER!>NestedEntry<!>
|
||||
inObject()
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package
|
||||
|
||||
package test {
|
||||
public fun testAccess(): kotlin.Unit
|
||||
|
||||
private final class TopLevelClass {
|
||||
public constructor TopLevelClass()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun test(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
private final class NestedClass {
|
||||
public constructor NestedClass()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public final class InNested {
|
||||
public constructor InNested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final enum class TopLevelEnum : kotlin.Enum<test.TopLevelEnum> {
|
||||
enum entry E1
|
||||
|
||||
private constructor TopLevelEnum(/*0*/ e: test.TopLevelEnum.NestedEnum)
|
||||
private final val e: test.TopLevelEnum.NestedEnum
|
||||
public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.TopLevelEnum): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<test.TopLevelEnum!>!
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
private final enum class NestedEnum : kotlin.Enum<test.TopLevelEnum.NestedEnum> {
|
||||
enum entry NestedEntry
|
||||
|
||||
private constructor NestedEnum()
|
||||
public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.TopLevelEnum.NestedEnum): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<test.TopLevelEnum.NestedEnum!>!
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): test.TopLevelEnum.NestedEnum
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<test.TopLevelEnum.NestedEnum>
|
||||
}
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): test.TopLevelEnum
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<test.TopLevelEnum>
|
||||
}
|
||||
|
||||
private object TopLevelObject {
|
||||
private constructor TopLevelObject()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun inObject(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
// FILE: A.kt
|
||||
|
||||
class A {
|
||||
private class Nested {
|
||||
object O1
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: B.java
|
||||
|
||||
public class B {
|
||||
private static class JC {
|
||||
public static class JC1 {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: C.kt
|
||||
|
||||
import A.<!INVISIBLE_REFERENCE!>Nested<!>.*
|
||||
import B.<!INVISIBLE_REFERENCE!>JC<!>.JC1
|
||||
|
||||
fun test() {
|
||||
<!INVISIBLE_MEMBER!>O1<!>
|
||||
<!INACCESSIBLE_TYPE!><!INVISIBLE_MEMBER!>JC1<!>()<!>
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
private final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public object O1 {
|
||||
private constructor O1()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public open class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
private open class JC {
|
||||
private constructor JC()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public open class JC1 {
|
||||
public constructor JC1()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package test
|
||||
|
||||
import test.TopLevelClass.NestedClass.*
|
||||
import test.TopLevelEnum.NestedEnum.*
|
||||
import test.TopLevelEnum.*
|
||||
|
||||
private class TopLevelClass {
|
||||
private class NestedClass {
|
||||
class A1
|
||||
object A2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
A1()
|
||||
A2
|
||||
}
|
||||
}
|
||||
|
||||
private enum class TopLevelEnum(private val e: NestedEnum) {
|
||||
E1(NestedEntry);
|
||||
|
||||
private enum class NestedEnum {
|
||||
NestedEntry;
|
||||
}
|
||||
}
|
||||
|
||||
fun testAccess() {
|
||||
E1
|
||||
<!INVISIBLE_MEMBER!>NestedEntry<!>
|
||||
<!INVISIBLE_MEMBER!>A1<!>()
|
||||
<!INVISIBLE_MEMBER!>A2<!>
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package
|
||||
|
||||
package test {
|
||||
public fun testAccess(): kotlin.Unit
|
||||
|
||||
private final class TopLevelClass {
|
||||
public constructor TopLevelClass()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun test(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
private final class NestedClass {
|
||||
public constructor NestedClass()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public final class A1 {
|
||||
public constructor A1()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public object A2 {
|
||||
private constructor A2()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final enum class TopLevelEnum : kotlin.Enum<test.TopLevelEnum> {
|
||||
enum entry E1
|
||||
|
||||
private constructor TopLevelEnum(/*0*/ e: test.TopLevelEnum.NestedEnum)
|
||||
private final val e: test.TopLevelEnum.NestedEnum
|
||||
public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.TopLevelEnum): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<test.TopLevelEnum!>!
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
private final enum class NestedEnum : kotlin.Enum<test.TopLevelEnum.NestedEnum> {
|
||||
enum entry NestedEntry
|
||||
|
||||
private constructor NestedEnum()
|
||||
public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.TopLevelEnum.NestedEnum): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<test.TopLevelEnum.NestedEnum!>!
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): test.TopLevelEnum.NestedEnum
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<test.TopLevelEnum.NestedEnum>
|
||||
}
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): test.TopLevelEnum
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<test.TopLevelEnum>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user