[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:
@@ -1,6 +1,6 @@
|
||||
open class SomeClass<T>
|
||||
class TestSome<P> {
|
||||
companion object : SomeClass<P>() {
|
||||
companion object : SomeClass<<!UNRESOLVED_REFERENCE!>P<!>>() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
open class SomeClass<T>
|
||||
class TestSome<P> {
|
||||
object Some : SomeClass<P>() {
|
||||
object Some : SomeClass<<!UNRESOLVED_REFERENCE!>P<!>>() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// FIR_IDENTICAL
|
||||
// KT-54748
|
||||
|
||||
sealed class Result<String> {
|
||||
data class Success(val value: String) : Result<String>()
|
||||
class Failure(val cause: Throwable) : Result<String>()
|
||||
}
|
||||
|
||||
fun foo(): Result<String> = Result.Success("...")
|
||||
Reference in New Issue
Block a user