Replace equals with == involving FP types: handle possible smart casts

This fixes two relevant tests with smart casts
#KT-25933 Fixed
This commit is contained in:
Mikhail Glukhikh
2018-10-09 14:47:01 +03:00
parent 04cadf3f58
commit 6be65e7d1a
6 changed files with 67 additions and 5 deletions
@@ -38,7 +38,7 @@ fun calcProperTypeForIeee754ArithmeticIfNeeded(
private fun KotlinType.isFloatingPointOrNullable() =
KotlinBuiltIns.isDoubleOrNullableDouble(this) || KotlinBuiltIns.isFloatOrNullableFloat(this)
private fun KtExpression.getKotlinTypeForComparison(bindingContext: BindingContext): KotlinType? =
fun KtExpression.getKotlinTypeForComparison(bindingContext: BindingContext): KotlinType? =
when {
this is KtProperty -> bindingContext[BindingContext.VARIABLE, this]?.type
else -> kotlinType(bindingContext)