Approximate expected type before reporting INTEGER_OPERATOR_RESOLVE_WILL_CHANGE

^KT-47447 Fixed
This commit is contained in:
Dmitriy Novozhilov
2021-06-25 16:33:13 +03:00
committed by TeamCityServer
parent 5bfdd5be5f
commit 24bb9a4e14
7 changed files with 35 additions and 1 deletions
@@ -19497,6 +19497,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
runTest("compiler/testData/diagnostics/tests/numbers/kt41679.kt");
}
@Test
@TestMetadata("kt47447.kt")
public void testKt47447() throws Exception {
runTest("compiler/testData/diagnostics/tests/numbers/kt47447.kt");
}
@Test
@TestMetadata("literalReceiverWithIntegerValueType.kt")
public void testLiteralReceiverWithIntegerValueType() throws Exception {
@@ -19497,6 +19497,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
runTest("compiler/testData/diagnostics/tests/numbers/kt41679.kt");
}
@Test
@TestMetadata("kt47447.kt")
public void testKt47447() throws Exception {
runTest("compiler/testData/diagnostics/tests/numbers/kt47447.kt");
}
@Test
@TestMetadata("literalReceiverWithIntegerValueType.kt")
public void testLiteralReceiverWithIntegerValueType() throws Exception {
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
import org.jetbrains.kotlin.resolve.constants.IntegerLiteralTypeConstructor
import org.jetbrains.kotlin.resolve.constants.IntegerValueTypeConstant
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.types.lowerIfFlexible
object NewSchemeOfIntegerOperatorResolutionChecker : CallChecker {
override fun check(resolvedCall: ResolvedCall<*>, reportOn: PsiElement, context: CallCheckerContext) {
@@ -30,7 +31,7 @@ object NewSchemeOfIntegerOperatorResolutionChecker : CallChecker {
valueParameter.varargElementType ?: continue
} else {
valueParameter.type
}.unwrap()
}.unwrap().lowerIfFlexible()
for (argument in arguments.arguments) {
val expression = argument.getArgumentExpression() ?: continue
val compileTimeValue =
@@ -0,0 +1,6 @@
// FIR_IDENTICAL
// LANGUAGE: -ApproximateIntegerLiteralTypesInReceiverPosition
// ISSUE: KT-47447
// FULL_JDK
fun test()= java.util.Objects.requireNonNull(1 + 1)
@@ -0,0 +1,3 @@
package
public fun test(): kotlin.Int!
@@ -19503,6 +19503,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/numbers/kt41679.kt");
}
@Test
@TestMetadata("kt47447.kt")
public void testKt47447() throws Exception {
runTest("compiler/testData/diagnostics/tests/numbers/kt47447.kt");
}
@Test
@TestMetadata("literalReceiverWithIntegerValueType.kt")
public void testLiteralReceiverWithIntegerValueType() throws Exception {
@@ -19497,6 +19497,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
runTest("compiler/testData/diagnostics/tests/numbers/kt41679.kt");
}
@Test
@TestMetadata("kt47447.kt")
public void testKt47447() throws Exception {
runTest("compiler/testData/diagnostics/tests/numbers/kt47447.kt");
}
@Test
@TestMetadata("literalReceiverWithIntegerValueType.kt")
public void testLiteralReceiverWithIntegerValueType() throws Exception {