Files
kotlin-fork/compiler/testData/diagnostics/tests/regressions/kt498.kt
T
2017-08-29 18:01:36 +03:00

8 lines
339 B
Kotlin
Vendored

// 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. ?!!!
}