Cast never succeeds: special 'Nothing' / 'Nothing?' case
(cherry picked from commit 63435b4)
This commit is contained in:
committed by
Mikhail Glukhikh
parent
bf4231d65a
commit
b56e84d47f
@@ -38,6 +38,8 @@ object CastDiagnosticsUtil {
|
||||
rhsType: KotlinType,
|
||||
platformToKotlinClassMap: PlatformToKotlinClassMap): Boolean {
|
||||
if (KotlinBuiltIns.isNullableNothing(lhsType) && !TypeUtils.isNullableType(rhsType)) return false
|
||||
if (KotlinBuiltIns.isNothing(rhsType)) return false
|
||||
if (KotlinBuiltIns.isNullableNothing(rhsType)) return TypeUtils.isNullableType(lhsType)
|
||||
if (lhsType.isError) return true
|
||||
if (isRelated(lhsType, rhsType, platformToKotlinClassMap)) return true
|
||||
// This is an oversimplification (which does not render the method incomplete):
|
||||
|
||||
Reference in New Issue
Block a user