Fixed one of the cases with lambda's returning Nothing

This commit is contained in:
Valentin Kipyatkov
2014-11-21 18:46:18 +03:00
parent c5afc219b9
commit 32a13502c5
4 changed files with 46 additions and 9 deletions
@@ -392,5 +392,10 @@ public fun Call.isSafeCall(): Boolean {
public fun Call.isExplicitSafeCall(): Boolean = getCallOperationNode()?.getElementType() == JetTokens.SAFE_ACCESS
public fun JetTypeReference?.isProbablyNothing(): Boolean
= (this?.getTypeElement() as? JetUserType)?.getReferencedName() == "Nothing"
public fun JetTypeReference?.isProbablyNothing(): Boolean {
val userType = this?.getTypeElement() as? JetUserType ?: return false
return userType.isProbablyNothing()
}
public fun JetUserType?.isProbablyNothing(): Boolean
= this?.getReferencedName() == "Nothing"