NI: intersect DFI types before capturing

^KT-37887 Fixed
This commit is contained in:
Victor Petukhov
2020-05-14 13:43:30 +03:00
parent 5a7ceec985
commit 73dec25eb1
15 changed files with 141 additions and 32 deletions
@@ -72,7 +72,7 @@ class ParseErrorKotlinCallArgument(
) : ExpressionKotlinCallArgument, SimplePSIKotlinCallArgument() {
override val receiver = ReceiverValueWithSmartCastInfo(
TransientReceiver(ErrorUtils.createErrorType("Error type for ParseError-argument $valueArgument")),
possibleTypes = emptySet(),
typesFromSmartCasts = emptySet(),
isStable = true
)
@@ -471,7 +471,7 @@ class PSICallResolver(
private fun createReceiverCallArgument(variable: KotlinResolutionCandidate): SimpleKotlinCallArgument {
variable.forceResolution()
val variableReceiver = createReceiverValueWithSmartCastInfo(variable)
if (variableReceiver.possibleTypes.isNotEmpty()) {
if (variableReceiver.hasTypesFromSmartCasts()) {
return ReceiverExpressionKotlinCallArgument(
createReceiverValueWithSmartCastInfo(variable),
isForImplicitInvoke = true