Get rid of !! in getDataFlowAwareTypes #KT-28200 Fixed

This commit is contained in:
Mikhail Glukhikh
2018-11-16 17:34:21 +03:00
parent 5385efd7d7
commit 0489efc0ae
@@ -349,10 +349,9 @@ fun getDataFlowAwareTypes(
if (originalType == null) return emptyList()
val dataFlowInfo = bindingContext.getDataFlowInfoAfter(expression)
val dataFlowValueFactory = expression.getResolutionFacade().frontendService<DataFlowValueFactory>()
val expressionType = bindingContext.getType(expression) ?: return listOf(originalType)
val dataFlowValue = dataFlowValueFactory.createDataFlowValue(
expression,
bindingContext.getType(expression)!!,
bindingContext, expression.getResolutionFacade().moduleDescriptor
expression, expressionType, bindingContext, expression.getResolutionFacade().moduleDescriptor
)
return dataFlowInfo.getCollectedTypes(dataFlowValue, expression.languageVersionSettings).ifEmpty { listOf(originalType) }
}