diff --git a/compiler/testData/diagnostics/tests/evaluate/binaryMinusIndependentExpType.kt b/compiler/testData/diagnostics/tests/evaluate/binaryMinusIndependentExpType.kt index a5c5f5bfe1e..29155268069 100644 --- a/compiler/testData/diagnostics/tests/evaluate/binaryMinusIndependentExpType.kt +++ b/compiler/testData/diagnostics/tests/evaluate/binaryMinusIndependentExpType.kt @@ -1,24 +1,24 @@ val p1: Int = 1 - 1 -val p2: Long = 1 - 1 -val p3: Byte = 1 - 1 -val p4: Short = 1 - 1 +val p2: Long = 1 - 1 +val p3: Byte = 1 - 1 +val p4: Short = 1 - 1 val l1: Long = 1 - 1.toLong() -val l2: Byte = 1 - 1.toLong() -val l3: Int = 1 - 1.toLong() -val l4: Short = 1 - 1.toLong() +val l2: Byte = 1 - 1.toLong() +val l3: Int = 1 - 1.toLong() +val l4: Short = 1 - 1.toLong() -val b1: Byte = 1 - 1.toByte() +val b1: Byte = 1 - 1.toByte() val b2: Int = 1 - 1.toByte() -val b3: Long = 1 - 1.toByte() -val b4: Short = 1 - 1.toByte() +val b3: Long = 1 - 1.toByte() +val b4: Short = 1 - 1.toByte() -val i1: Byte = 1 - 1.toInt() +val i1: Byte = 1 - 1.toInt() val i2: Int = 1 - 1.toInt() -val i3: Long = 1 - 1.toInt() -val i4: Short = 1 - 1.toInt() +val i3: Long = 1 - 1.toInt() +val i4: Short = 1 - 1.toInt() -val s1: Byte = 1 - 1.toShort() +val s1: Byte = 1 - 1.toShort() val s2: Int = 1 - 1.toShort() -val s3: Long = 1 - 1.toShort() -val s4: Short = 1 - 1.toShort() +val s3: Long = 1 - 1.toShort() +val s4: Short = 1 - 1.toShort() diff --git a/compiler/testData/diagnostics/tests/evaluate/binaryMinusIndependentExpType.txt b/compiler/testData/diagnostics/tests/evaluate/binaryMinusIndependentExpType.txt index b63075dcd1c..789c278a03d 100644 --- a/compiler/testData/diagnostics/tests/evaluate/binaryMinusIndependentExpType.txt +++ b/compiler/testData/diagnostics/tests/evaluate/binaryMinusIndependentExpType.txt @@ -13,9 +13,9 @@ public val l2: kotlin.Byte = 0.toLong() public val l3: kotlin.Int = 0.toLong() public val l4: kotlin.Short = 0.toLong() public val p1: kotlin.Int = 0 -public val p2: kotlin.Long = 0 -public val p3: kotlin.Byte = 0 -public val p4: kotlin.Short = 0 +public val p2: kotlin.Long = 0.toLong() +public val p3: kotlin.Byte = 0.toByte() +public val p4: kotlin.Short = 0.toShort() public val s1: kotlin.Byte = 0 public val s2: kotlin.Int = 0 public val s3: kotlin.Long = 0 diff --git a/compiler/testData/diagnostics/tests/evaluate/divisionByZero.kt b/compiler/testData/diagnostics/tests/evaluate/divisionByZero.kt index c6f36e97204..ab83e4bba4b 100644 --- a/compiler/testData/diagnostics/tests/evaluate/divisionByZero.kt +++ b/compiler/testData/diagnostics/tests/evaluate/divisionByZero.kt @@ -15,7 +15,7 @@ val a10 = 1 / 0.0f val a11 = 1 / 0.0 val a12 = 1L / 0 -val b1: Byte = 1 / 0 +val b1: Byte = 1 / 0 @Ann(1 / 0) val b2 = 1 -annotation class Ann(val i : Int) \ No newline at end of file +annotation class Ann(val i : Int) diff --git a/compiler/testData/diagnostics/tests/evaluate/parentesized.kt b/compiler/testData/diagnostics/tests/evaluate/parentesized.kt index 75bf9896b1f..4ff230d0a85 100644 --- a/compiler/testData/diagnostics/tests/evaluate/parentesized.kt +++ b/compiler/testData/diagnostics/tests/evaluate/parentesized.kt @@ -1,4 +1,5 @@ // FIR_IDENTICAL +// LANGUAGE: +ApproximateIntegerLiteralTypesInReceiverPosition val p1: Byte = (1 + 2) * 2 val p2: Short = (1 + 2) * 2 val p3: Int = (1 + 2) * 2 diff --git a/compiler/testData/diagnostics/tests/operatorRem/numberRemConversions.kt b/compiler/testData/diagnostics/tests/operatorRem/numberRemConversions.kt index 5b6d85a56b9..6ea95abe126 100644 --- a/compiler/testData/diagnostics/tests/operatorRem/numberRemConversions.kt +++ b/compiler/testData/diagnostics/tests/operatorRem/numberRemConversions.kt @@ -7,9 +7,9 @@ fun fooShort(p: Short) = p fun test() { fooInt(1 % 1) - fooByte(1 % 1) - fooLong(1 % 1) - fooShort(1 % 1) + fooByte(1 % 1) + fooLong(1 % 1) + fooShort(1 % 1) } public operator fun Int.rem(other: Int): Int = 0 diff --git a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/signedToUnsignedConversionWithExpectedType.kt b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/signedToUnsignedConversionWithExpectedType.kt index 91b7d7006a6..bf30f8146d0 100644 --- a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/signedToUnsignedConversionWithExpectedType.kt +++ b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/signedToUnsignedConversionWithExpectedType.kt @@ -10,8 +10,8 @@ fun takeUBytes(vararg u: UByte) {} fun takeNullableUInt(u: UInt?) {} fun test() { - takeUInt(1 + 2) - takeUInt(1.plus(2)) + takeUInt(1 + 2) + takeUInt(1.plus(2)) takeNullableUInt(4) takeUInt(Int.MAX_VALUE * 2L) @@ -33,7 +33,7 @@ fun test() { takeUInt(Int.MAX_VALUE * 2) takeUInt(4294967294) - takeUBytes(1, 2, 255, 256, 0, -1, 40 + 2) + takeUBytes(1, 2, 255, 256, 0, -1, 40 + 2) takeUInt(1.myPlus(2)) diff --git a/compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt b/compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt index e41d2c4a1dd..ffddb756eb7 100644 --- a/compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt +++ b/compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt @@ -20,7 +20,7 @@ fun first(arg: Int) = when (arg) { 1 -> 6 2 -> 7 // Error should be here: see KT-11971 - four -> 8 + four -> 8 else -> 0 } diff --git a/compiler/testData/diagnostics/tests/when/When.kt b/compiler/testData/diagnostics/tests/when/When.kt index e73872c2a5f..a04cb887c8f 100644 --- a/compiler/testData/diagnostics/tests/when/When.kt +++ b/compiler/testData/diagnostics/tests/when/When.kt @@ -43,7 +43,7 @@ fun test() { s -> 1 "" -> 1 x -> 1 - 1 -> 1 + 1 -> 1 } val z = 1 diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index 9f823c95ff3..6ab91228a5f 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -201,7 +201,6 @@ enum class LanguageFeature( PrivateInFileEffectiveVisibility(KOTLIN_1_6, kind = BUG_FIX), ForbidUsingExtensionPropertyTypeParameterInDelegate(KOTLIN_1_6, kind = BUG_FIX), ProhibitSelfCallsInNestedObjects(KOTLIN_1_6, kind = BUG_FIX), - ApproximateIntegerLiteralTypesInReceiverPosition(KOTLIN_1_6), ProperCheckAnnotationsTargetInTypeUsePositions(KOTLIN_1_6, kind = BUG_FIX), AbstractClassMemberNotImplementedWithIntermediateAbstractClass(KOTLIN_1_6, kind = BUG_FIX), @@ -230,6 +229,7 @@ enum class LanguageFeature( DefinitelyNonNullableTypes(KOTLIN_1_7), ProhibitSimplificationOfNonTrivialConstBooleanExpressions(KOTLIN_1_7), SafeCallsAreAlwaysNullable(KOTLIN_1_7), + ApproximateIntegerLiteralTypesInReceiverPosition(KOTLIN_1_7), // Temporarily disabled, see KT-27084/KT-22379 SoundSmartcastFromLoopConditionForLoopAssignedVariables(sinceVersion = null, kind = BUG_FIX),