[FIR] Fix exposed visibility checking for enum entries
This commit is contained in:
+9
-1
@@ -6,4 +6,12 @@ class A {
|
||||
|
||||
abstract class B {
|
||||
fun <!EXPOSED_FUNCTION_RETURN_TYPE!>foo<!>(str: String): A.InnerA
|
||||
}
|
||||
}
|
||||
|
||||
private enum class Some {
|
||||
FIRST {
|
||||
override fun foo(): Some = FIRST
|
||||
};
|
||||
|
||||
abstract fun foo(): Some
|
||||
}
|
||||
|
||||
+25
@@ -20,3 +20,28 @@ FILE: exposedFunctionReturnType.kt
|
||||
public final fun foo(str: R|kotlin/String|): R|A.InnerA|
|
||||
|
||||
}
|
||||
private final enum class Some : R|kotlin/Enum<Some>| {
|
||||
private constructor(): R|Some| {
|
||||
super<R|kotlin/Enum<Some>|>()
|
||||
}
|
||||
|
||||
public final static enum entry FIRST: R|Some| = object : R|Some| {
|
||||
private constructor(): R|<anonymous>| {
|
||||
super<R|Some|>()
|
||||
}
|
||||
|
||||
public final override fun foo(): R|Some| {
|
||||
^foo R|/Some.FIRST|
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public abstract fun foo(): R|Some|
|
||||
|
||||
public final static fun values(): R|kotlin/Array<Some>| {
|
||||
}
|
||||
|
||||
public final static fun valueOf(value: R|kotlin/String|): R|Some| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -81,7 +81,9 @@ class FirEffectiveVisibilityResolverImpl(private val session: FirSession) : FirE
|
||||
|
||||
if (!succeededToGetSymbol) {
|
||||
if (parentClassId?.isLocal == false) {
|
||||
// ?: is needed to get enum from enum entry
|
||||
parentSymbol = session.firSymbolProvider.getClassLikeSymbolByFqName(parentClassId)
|
||||
?: parentClassId.outerClassId?.let { session.firSymbolProvider.getClassLikeSymbolByFqName(it) }
|
||||
parentSymbol?.fir.safeAs<FirMemberDeclaration>()?.let {
|
||||
parentEffectiveVisibility = resolveFor(it, null, scopeSession)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user