[FIR] Add UNCHECKED_CAST

Regenerate diagnostics code
This commit is contained in:
Ivan Kochurkin
2021-09-16 23:24:58 +03:00
committed by TeamCityServer
parent 1fbccff1bd
commit d0a4ca199d
70 changed files with 118 additions and 933 deletions
@@ -1,11 +0,0 @@
// KT-307 Unresolved reference
open class AL {
fun get(i : Int) : Any? = i
}
interface ALE<T> : <!INTERFACE_WITH_SUPERCLASS!>AL<!> {
fun getOrNull(index: Int, value: T) : T {
return get(index) as? T ?: value
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// KT-307 Unresolved reference
open class AL {
@@ -4,5 +4,5 @@
class IdUnavailableException() : Exception() {}
fun <T : Any> T.getJavaClass() : Class<T> {
return ((this as Object).getClass()) as Class<T> // Some error here, because of Exception() used above. ?!!!
}
return ((this as Object).getClass()) <!UNCHECKED_CAST!>as Class<T><!> // Some error here, because of Exception() used above. ?!!!
}
@@ -6,7 +6,7 @@ fun <T> typeinfo() : TypeInfo<T> = null <!CAST_NEVER_SUCCEEDS!>as<!> TypeInfo<T>
fun <T> TypeInfo<T>.getJavaClass() : java.lang.Class<T> {
val t : java.lang.Object = this as java.lang.Object
return t.getClass() as java.lang.Class<T> // inferred type is Object but Serializable was expected
return t.getClass() <!UNCHECKED_CAST!>as java.lang.Class<T><!> // inferred type is Object but Serializable was expected
}
fun <T> getJavaClass() = typeinfo<T>().getJavaClass()