f26059a7d3
^KT-46860
18 lines
864 B
Kotlin
Vendored
18 lines
864 B
Kotlin
Vendored
// KT-702 Type inference failed
|
|
fun <T> getJavaClass() : java.lang.Class<T> { return "" as Class<T> }
|
|
|
|
public class Throwables() {
|
|
companion object {
|
|
public fun <X : Throwable?> propagateIfInstanceOf(throwable : Throwable?, declaredType : Class<X?>?) {
|
|
if (((throwable != null) && declaredType?.isInstance(throwable)!!))
|
|
{
|
|
throw <!SAFE_CALL_WILL_CHANGE_NULLABILITY!>declaredType<!UNNECESSARY_SAFE_CALL!>?.<!>cast(throwable)<!>!!
|
|
}
|
|
}
|
|
public fun propagateIfPossible(throwable : Throwable?) {
|
|
propagateIfInstanceOf(throwable, getJavaClass<Error?>()) //; Type inference failed: Mismatch while expanding constraints
|
|
propagateIfInstanceOf(throwable, getJavaClass<RuntimeException?>()) // Type inference failed: Mismatch while expanding constraints
|
|
}
|
|
}
|
|
}
|