Smart cast is performed now inside 'x as? Type ?: return' safe as / elvis combination #KT-10992 Fixed
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// See also KT-10992: we should have no errors for all unsafe hashCode() calls
|
||||
|
||||
fun foo(arg: Any?) {
|
||||
val x = arg as? Any ?: return
|
||||
<!DEBUG_INFO_SMARTCAST!>arg<!>.hashCode()
|
||||
x.hashCode()
|
||||
}
|
||||
|
||||
fun bar(arg: Any?) {
|
||||
arg as? Any ?: return
|
||||
<!DEBUG_INFO_SMARTCAST!>arg<!>.hashCode()
|
||||
}
|
||||
|
||||
fun gav(arg: Any?) {
|
||||
arg as? String ?: return
|
||||
<!DEBUG_INFO_SMARTCAST!>arg<!>.length
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
public fun bar(/*0*/ arg: kotlin.Any?): kotlin.Unit
|
||||
public fun foo(/*0*/ arg: kotlin.Any?): kotlin.Unit
|
||||
public fun gav(/*0*/ arg: kotlin.Any?): kotlin.Unit
|
||||
Reference in New Issue
Block a user