[FE 1.0] Disable INTEGER_OPERATOR_RESOLVE_WILL_CHANGE warning by default
Also remove sinceVersion parameter from ApproximateIntegerLiteralTypesInReceiverPosition language feature ^KT-48992 Fixed
This commit is contained in:
committed by
TeamCityServer
parent
212c3e8d51
commit
7917e511ed
+7
-2
@@ -35,7 +35,7 @@ import org.jetbrains.kotlin.types.typeUtil.makeNotNullable
|
||||
|
||||
object NewSchemeOfIntegerOperatorResolutionChecker : CallChecker {
|
||||
override fun check(resolvedCall: ResolvedCall<*>, reportOn: PsiElement, context: CallCheckerContext) {
|
||||
if (context.languageVersionSettings.supportsFeature(LanguageFeature.ApproximateIntegerLiteralTypesInReceiverPosition)) return
|
||||
if (!context.languageVersionSettings.needReport()) return
|
||||
for ((valueParameter, arguments) in resolvedCall.valueArguments) {
|
||||
val expectedType = if (valueParameter.isVararg) {
|
||||
valueParameter.varargElementType ?: continue
|
||||
@@ -52,6 +52,11 @@ object NewSchemeOfIntegerOperatorResolutionChecker : CallChecker {
|
||||
}
|
||||
}
|
||||
|
||||
private fun LanguageVersionSettings.needReport(): Boolean {
|
||||
return supportsFeature(LanguageFeature.ReportChangingIntegerOperatorResolve) &&
|
||||
!supportsFeature(LanguageFeature.ApproximateIntegerLiteralTypesInReceiverPosition)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun checkArgument(
|
||||
expectedType: KotlinType,
|
||||
@@ -60,7 +65,7 @@ object NewSchemeOfIntegerOperatorResolutionChecker : CallChecker {
|
||||
trace: BindingTrace,
|
||||
moduleDescriptor: ModuleDescriptor
|
||||
) {
|
||||
if (languageVersionSettings.supportsFeature(LanguageFeature.ApproximateIntegerLiteralTypesInReceiverPosition)) return
|
||||
if (!languageVersionSettings.needReport()) return
|
||||
val type = expectedType.lowerIfFlexible()
|
||||
if (type.isPrimitiveNumberOrNullableType()) {
|
||||
checkArgumentImpl(type, KtPsiUtil.deparenthesize(argument)!!, trace, moduleDescriptor)
|
||||
|
||||
Reference in New Issue
Block a user