[FIR] Only inherit class type parameters if inner class

Nested classes which are not inner class should not be able to access
type parameters of the outer class. Make sure access is not available
when resolving super types.

#KT-54748 Fixed
This commit is contained in:
Brian Norman
2023-05-26 09:19:09 -05:00
committed by Space Team
parent dfae730d0f
commit e10a9263d0
15 changed files with 79 additions and 47 deletions
@@ -9,7 +9,7 @@ private fun <E> foobar() = {
fun a() = A<E, X, Y, Z>()
}
typealias LocalAlias<W> = A<E, <!UNRESOLVED_REFERENCE!>X<!>, <!UNRESOLVED_REFERENCE!>Y<!>, W>
typealias LocalAlias<W> = A<E, X, Y, W>
}
class Derived : LocalOuter<Double, Short>() {
@@ -26,7 +26,7 @@ private fun noParameters() = {
fun a() = A<Any, X, Y, Z>()
}
typealias LocalAlias2<W> = A<Any, <!UNRESOLVED_REFERENCE!>X<!>, <!UNRESOLVED_REFERENCE!>Y<!>, W>
typealias LocalAlias2<W> = A<Any, X, Y, W>
}
class Derived2 : LocalOuter2<Double, Short>() {
@@ -11,7 +11,7 @@ class Outer<T> {
fun a() = A<T, F, E, X, Y, Z>()
}
typealias LocalAlias<W> = A<T, F, E, <!UNRESOLVED_REFERENCE!>X<!>, <!UNRESOLVED_REFERENCE!>Y<!>, W>
typealias LocalAlias<W> = A<T, F, E, X, Y, W>
}
class Derived : LocalOuter<Double, Short>() {
@@ -28,7 +28,7 @@ class Outer<T> {
fun a() = A<T, F, Any, X, Y, Z>()
}
typealias LocalAlias2<W> = A<T, F, Any, <!UNRESOLVED_REFERENCE!>X<!>, <!UNRESOLVED_REFERENCE!>Y<!>, W>
typealias LocalAlias2<W> = A<T, F, Any, X, Y, W>
}
class Derived2 : LocalOuter2<Double, Short>() {