Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/innerClasses/kt3357.kt
T
Ilya Kirillov 1bbcae5ed2 [FIR] fix resolve contract violation from scopes
We cannot call lazy resolve to STATUS phase from scopes as scopes may be accessed on a STATUS phase or earlier

^KT-54890
^KTIJ-23587 fixed
2023-01-13 21:32:51 +00:00

20 lines
560 B
Kotlin
Vendored

// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE
open class Super<T> {
inner open class Inner {
open fun getOuter(): Super<T> = throw UnsupportedOperationException()
}
}
class Sub<T1>(): Super<T1>() {
inner class SubInner : Super<T1>.Inner() { // 'Inner' is unresolved
// Also, T1 is not resolved to anything, and not marked as resolved
init {
val x: Super<T1>.Inner = this // T1 is not resolved to anything
}
override fun getOuter(): Sub<T1> = throw UnsupportedOperationException()
}
}