Wrap with safe let call : minor refactoring

This commit is contained in:
Mikhail Glukhikh
2016-06-13 15:42:04 +03:00
parent 954952ae71
commit 10935ba9db
2 changed files with 5 additions and 5 deletions
@@ -71,6 +71,9 @@ fun KotlinType?.isArrayOfNothing(): Boolean {
fun KotlinType.isSubtypeOf(superType: KotlinType): Boolean = KotlinTypeChecker.DEFAULT.isSubtypeOf(this, superType)
fun isNullabilityMismatch(expected: KotlinType, actual: KotlinType) =
!expected.isMarkedNullable && actual.isMarkedNullable && actual.isSubtypeOf(TypeUtils.makeNullable(expected))
fun KotlinType.cannotBeReified(): Boolean =
KotlinBuiltIns.isNothingOrNullableNothing(this) || this.isDynamic() || this.isCaptured()