Use proper type for nullability check in 'calcTypeForIEEE754ArithmeticIfNeeded'

This commit is contained in:
Mikhael Bogdanov
2017-02-02 11:43:34 +01:00
parent 5cffb3892d
commit 560226cc84
@@ -288,10 +288,10 @@ fun calcTypeForIEEE754ArithmeticIfNeeded(expression: KtExpression?, bindingConte
val stableTypes = bindingContext.getDataFlowInfoBefore(expression).getStableTypes(dataFlow)
return stableTypes.firstNotNullResult {
if (KotlinBuiltIns.isDoubleOrNullableDouble(it)) {
TypeAndNullability(Type.DOUBLE_TYPE, TypeUtils.isNullableType(ktType))
TypeAndNullability(Type.DOUBLE_TYPE, TypeUtils.isNullableType(it))
}
else if (KotlinBuiltIns.isFloatOrNullableFloat(it)) {
TypeAndNullability(Type.FLOAT_TYPE, TypeUtils.isNullableType(ktType))
TypeAndNullability(Type.FLOAT_TYPE, TypeUtils.isNullableType(it))
}
else {
null