Files
kotlin-fork/compiler/testData/diagnostics/tests/regressions/kt498.kt
T
2021-11-24 23:13:41 +03:00

10 lines
382 B
Kotlin
Vendored

// FIR_IDENTICAL
// WITH_EXTENDED_CHECKERS
// JAVAC_EXPECTED_FILE
// KT-498 Very strange error in the type checker
class IdUnavailableException() : Exception() {}
fun <T : Any> T.getJavaClass() : Class<T> {
return ((this as <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>Object<!>).getClass()) <!UNCHECKED_CAST!>as Class<T><!> // Some error here, because of Exception() used above. ?!!!
}