Prefer stable types to diagnose useless cast
#KT-11622 Fixed
This commit is contained in:
Vendored
+5
-5
@@ -7,12 +7,12 @@ fun test() : Unit {
|
||||
checkSubtype<Int?>(x)
|
||||
checkSubtype<Int>(y)
|
||||
checkSubtype<Int>(x as Int)
|
||||
checkSubtype<Int>(y <warning>as Int</warning>)
|
||||
checkSubtype<Int?>(x <warning>as Int?</warning>)
|
||||
checkSubtype<Int>(y <warning descr="[USELESS_CAST] No cast needed">as Int</warning>)
|
||||
checkSubtype<Int?>(x as Int?)
|
||||
checkSubtype<Int?>(y as Int?)
|
||||
checkSubtype<Int?>(x <warning>as Int?</warning>)
|
||||
checkSubtype<Int?>(y <warning>as? Int</warning>)
|
||||
checkSubtype<Int?>(x <warning>as? Int?</warning>)
|
||||
checkSubtype<Int?>(x as Int?)
|
||||
checkSubtype<Int?>(y <warning descr="[USELESS_CAST] No cast needed">as? Int</warning>)
|
||||
checkSubtype<Int?>(x as? Int?)
|
||||
checkSubtype<Int?>(y as? Int?)
|
||||
Unit
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user