DataFlowInfo Refactoring: getNullability() --> getCollectedNullability(); getPossibleTypes() --> getCollectedTypes()
This commit is contained in:
+1
-1
@@ -128,7 +128,7 @@ fun KtExpression.guessTypes(
|
||||
val theType1 = context.getType(this)
|
||||
if (theType1 != null) {
|
||||
val dataFlowInfo = context.getDataFlowInfo(this)
|
||||
val possibleTypes = dataFlowInfo.getPossibleTypes(DataFlowValueFactory.createDataFlowValue(this, theType1, context, module))
|
||||
val possibleTypes = dataFlowInfo.getCollectedTypes(DataFlowValueFactory.createDataFlowValue(this, theType1, context, module))
|
||||
return if (possibleTypes.isNotEmpty()) possibleTypes.toTypedArray() else arrayOf(theType1)
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -182,13 +182,13 @@ data class ExtractionData(
|
||||
val dataFlowInfo = context.getDataFlowInfo(expression)
|
||||
|
||||
(resolvedCall?.getImplicitReceiverValue() as? ImplicitReceiver)?.let {
|
||||
return dataFlowInfo.getPossibleTypes(DataFlowValueFactory.createDataFlowValueForStableReceiver(it))
|
||||
return dataFlowInfo.getCollectedTypes(DataFlowValueFactory.createDataFlowValueForStableReceiver(it))
|
||||
}
|
||||
|
||||
val type = resolvedCall?.resultingDescriptor?.returnType ?: return emptySet()
|
||||
val containingDescriptor = expression.getResolutionScope(context, expression.getResolutionFacade()).ownerDescriptor
|
||||
val dataFlowValue = DataFlowValueFactory.createDataFlowValue(expression, type, context, containingDescriptor)
|
||||
return dataFlowInfo.getPossibleTypes(dataFlowValue)
|
||||
return dataFlowInfo.getCollectedTypes(dataFlowValue)
|
||||
}
|
||||
|
||||
fun getBrokenReferencesInfo(body: KtBlockExpression): List<ResolvedReferenceInfo> {
|
||||
|
||||
+1
-1
@@ -313,7 +313,7 @@ private fun suggestParameterType(
|
||||
receiverToExtract is ImplicitReceiver -> {
|
||||
val typeByDataFlowInfo = if (useSmartCastsIfPossible) {
|
||||
val dataFlowInfo = bindingContext.getDataFlowInfo(resolvedCall!!.call.callElement)
|
||||
val possibleTypes = dataFlowInfo.getPossibleTypes(DataFlowValueFactory.createDataFlowValueForStableReceiver(receiverToExtract))
|
||||
val possibleTypes = dataFlowInfo.getCollectedTypes(DataFlowValueFactory.createDataFlowValueForStableReceiver(receiverToExtract))
|
||||
if (possibleTypes.isNotEmpty()) CommonSupertypes.commonSupertype(possibleTypes) else null
|
||||
} else null
|
||||
typeByDataFlowInfo ?: receiverToExtract.type
|
||||
|
||||
Reference in New Issue
Block a user