one more case of KT-445 Don't allow deep instanceof for erased parameters
=== (a : List<out Any>) is List<out Int> ===
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
// +JDK
|
||||
|
||||
import java.util.List
|
||||
|
||||
fun f(a : List<out Any>) = a is <!CANNOT_CHECK_FOR_ERASED!>List<out Int><!>
|
||||
@@ -4,5 +4,5 @@
|
||||
class IdUnavailableException() : Exception() {}
|
||||
|
||||
fun <T : Any> T.getJavaClass() : Class<T> {
|
||||
return ((this <!CAST_NEVER_SUCCEEDS!>as<!> Object).getClass()) as Class<T> // Some error here, because of Exception() used above. ?!!!
|
||||
return <!UNCHECKED_CAST!>((this <!CAST_NEVER_SUCCEEDS!>as<!> Object).getClass()) as Class<T><!> // Some error here, because of Exception() used above. ?!!!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user