Refactor DataFlowValueFactory into proper component

This commit is contained in:
Dmitry Savvinov
2018-02-13 13:48:08 +03:00
parent 03567a1c01
commit 0929673576
62 changed files with 397 additions and 242 deletions
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.psi.KtExpression
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.bindingContextUtil.getDataFlowInfoBefore
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactory
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactoryImpl
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.TypeUtils
import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult
@@ -56,7 +57,8 @@ fun legacyCalcTypeForIeee754ArithmeticIfNeeded(
)
}
val dataFlow = DataFlowValueFactory.createDataFlowValue(
// NB. Using DataFlowValueFactoryImpl is a hack, but it is ok for 'legacy'
val dataFlow = DataFlowValueFactoryImpl().createDataFlowValue(
expression!!,
ktType,
bindingContext,