Don't allow coercing receivers from signed to unsigned constants

This commit is contained in:
Mikhail Zarechenskiy
2020-06-03 13:32:14 +03:00
parent bfa648972f
commit e72401c5f4
4 changed files with 27 additions and 1 deletions
@@ -429,7 +429,7 @@ private fun KotlinResolutionCandidate.resolveKotlinArgument(
val unsubstitutedExpectedType = conversionDataBeforeSubtyping?.convertedType ?: candidateExpectedType
val expectedType = unsubstitutedExpectedType?.let { prepareExpectedType(it) }
val convertedArgument = if (expectedType != null && shouldRunConversionForConstants(expectedType)) {
val convertedArgument = if (expectedType != null && !isReceiver && shouldRunConversionForConstants(expectedType)) {
val convertedConstant = resolutionCallbacks.convertSignedConstantToUnsigned(argument)
if (convertedConstant != null) {
resolvedCall.registerArgumentWithConstantConversion(argument, convertedConstant)