Refine scope of signed to unsigned conversions

Depend on a module of function declaration, not function call
This commit is contained in:
Mikhail Zarechenskiy
2018-09-06 14:04:39 +03:00
parent e80a01a3fd
commit 3dd5a267b8
@@ -323,9 +323,6 @@ class CallCompleter(
val constant = context.trace[BindingContext.COMPILE_TIME_VALUE, deparenthesized]
val convertedConst = constant is IntegerValueTypeConstant && constant.convertedFromSigned
if (convertedConst && !moduleDescriptor.hasImplicitIntegerCoercionCapability()) {
context.trace.report(Errors.SIGNED_CONSTANT_CONVERTED_TO_UNSIGNED.on(deparenthesized))
}
if (results != null && results.isSingleResult) {
val resolvedCall = results.resultingCall
@@ -354,6 +351,8 @@ class CallCompleter(
)
}
}
} else if (convertedConst) {
context.trace.report(Errors.SIGNED_CONSTANT_CONVERTED_TO_UNSIGNED.on(deparenthesized))
}
updatedType = updateRecordedTypeForArgument(updatedType, recordedType, expression, context.statementFilter, context.trace)