Support warning about useless cast on safe cast
#KT-13348 Fixed
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
// See also KT-10992: we should have no errors for all unsafe hashCode() calls
|
||||
|
||||
fun foo(arg: Any?) {
|
||||
val x = arg as? Any ?: return
|
||||
val x = arg <!USELESS_CAST!>as? Any<!> ?: return
|
||||
<!DEBUG_INFO_SMARTCAST!>arg<!>.hashCode()
|
||||
x.hashCode()
|
||||
}
|
||||
|
||||
fun bar(arg: Any?) {
|
||||
arg as? Any ?: return
|
||||
arg <!USELESS_CAST!>as? Any<!> ?: return
|
||||
<!DEBUG_INFO_SMARTCAST!>arg<!>.hashCode()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user