diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt index e88879e9dec..48693d738e9 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt @@ -478,7 +478,10 @@ class DiagnosticReporterByTrackingStrategy( OnlyInputTypesDiagnostic::class.java -> { val typeVariable = (error as OnlyInputTypesDiagnostic).typeVariable as? TypeVariableFromCallableDescriptor ?: return psiKotlinCall.psiCall.calleeExpression?.let { - trace.report(TYPE_INFERENCE_ONLY_INPUT_TYPES.on(it, typeVariable.originalTypeParameter)) + val factory = if (context.languageVersionSettings.supportsFeature(LanguageFeature.StrictOnlyInputTypesChecks)) + TYPE_INFERENCE_ONLY_INPUT_TYPES + else TYPE_INFERENCE_ONLY_INPUT_TYPES_WARNING + trace.report(factory.on(it, typeVariable.originalTypeParameter)) } } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/BasicExpressionTypingVisitor.java b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/BasicExpressionTypingVisitor.java index 817a738da66..fd5c9a4ee78 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/BasicExpressionTypingVisitor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/BasicExpressionTypingVisitor.java @@ -1411,7 +1411,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor { boolean areAllCandidatesFailedWithOnlyInputTypesError = allCandidates.stream().allMatch((resolvedCall) -> resolvedCall instanceof NewAbstractResolvedCall && ((NewAbstractResolvedCall) resolvedCall).containsOnlyOnlyInputTypesErrors() ); - boolean isNonStrictOnlyInputTypesCheckEnabled = context.languageVersionSettings.supportsFeature(LanguageFeature.NonStrictOnlyInputTypesChecks); + boolean isNonStrictOnlyInputTypesCheckEnabled = !context.languageVersionSettings.supportsFeature(LanguageFeature.StrictOnlyInputTypesChecks); return areAllCandidatesFailedWithOnlyInputTypesError && isNonStrictOnlyInputTypesCheckEnabled; } diff --git a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferences.kt b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferences.kt index d507d499d1a..2774f8b99f4 100644 --- a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferences.kt +++ b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferences.kt @@ -1,5 +1,6 @@ // WITH_RUNTIME // DONT_TARGET_EXACT_BACKEND: WASM +// !LANGUAGE: -StrictOnlyInputTypesChecks import kotlin.experimental.ExperimentalTypeInference diff --git a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt index d507d499d1a..2774f8b99f4 100644 --- a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt +++ b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt @@ -1,5 +1,6 @@ // WITH_RUNTIME // DONT_TARGET_EXACT_BACKEND: WASM +// !LANGUAGE: -StrictOnlyInputTypesChecks import kotlin.experimental.ExperimentalTypeInference diff --git a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt index 17acd4c16a4..64e455093ff 100644 --- a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt +++ b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt @@ -1,5 +1,6 @@ // WITH_RUNTIME // DONT_TARGET_EXACT_BACKEND: WASM +// !LANGUAGE: -StrictOnlyInputTypesChecks import kotlin.experimental.ExperimentalTypeInference diff --git a/compiler/testData/codegen/box/inference/specialCallsWithCallableReferences.kt b/compiler/testData/codegen/box/inference/specialCallsWithCallableReferences.kt index 6f23813e1da..8d0781a3f6a 100644 --- a/compiler/testData/codegen/box/inference/specialCallsWithCallableReferences.kt +++ b/compiler/testData/codegen/box/inference/specialCallsWithCallableReferences.kt @@ -1,6 +1,7 @@ // WITH_RUNTIME // SKIP_TXT // DONT_TARGET_EXACT_BACKEND: WASM +// !LANGUAGE: -StrictOnlyInputTypesChecks import kotlin.experimental.ExperimentalTypeInference diff --git a/compiler/testData/codegen/box/operatorConventions/kt39880.kt b/compiler/testData/codegen/box/operatorConventions/kt39880.kt index bb95d494167..c264b98437a 100644 --- a/compiler/testData/codegen/box/operatorConventions/kt39880.kt +++ b/compiler/testData/codegen/box/operatorConventions/kt39880.kt @@ -1,5 +1,6 @@ // DONT_TARGET_EXACT_BACKEND: WASM // WITH_RUNTIME +// !LANGUAGE: -StrictOnlyInputTypesChecks fun foo(fn: () -> Boolean) {} diff --git a/compiler/testData/codegen/box/operatorConventions/kt42722.kt b/compiler/testData/codegen/box/operatorConventions/kt42722.kt index 49a15c995a6..1512ea2af16 100644 --- a/compiler/testData/codegen/box/operatorConventions/kt42722.kt +++ b/compiler/testData/codegen/box/operatorConventions/kt42722.kt @@ -1,5 +1,6 @@ // DONT_TARGET_EXACT_BACKEND: WASM // WITH_RUNTIME +// !LANGUAGE: -StrictOnlyInputTypesChecks fun box(): String { val set = setOf(1, 2, 3, 4, 5) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.kt index ad9b44a3dc4..8a8b670b894 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.kt @@ -444,8 +444,8 @@ fun poll8(): Flow { fun poll81(): Flow { return flow { - val inv = ::bar2 in setOf(::foo2) - inv() + val inv = ::bar2 in setOf(::foo2) + inv() } } @@ -458,8 +458,8 @@ fun poll82(): Flow { fun poll83(): Flow { return flow { - val inv = ::bar4 in setOf(::foo4) - inv + val inv = ::bar4 in setOf(::foo4) + inv } } @@ -486,7 +486,7 @@ fun poll86(): Flow { fun poll87(): Flow { return flow { - val inv = ::Foo7 in setOf(foo7()) + val inv = ::Foo7 in setOf(foo7()) inv } } diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt index 33e9423f8c4..a42308ab07c 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt @@ -57,15 +57,15 @@ fun poll75(): Flow { fun poll81(): Flow { return flow { - val inv = ::bar2 in setOf(::foo2) - inv() + val inv = ::bar2 in setOf(::foo2) + inv() } } fun poll83(): Flow { return flow { - val inv = ::bar4 in setOf(::foo4) - inv + val inv = ::bar4 in setOf(::foo4) + inv } } diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt index 1fc9b4a29dd..b90cf87a4f9 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt @@ -22,14 +22,14 @@ class Flow(private val block: suspend FlowCollector.() -> Unit) fun poll81(): Flow { return flow { - val inv = ::bar2 in setOf(::foo2) - inv() + val inv = ::bar2 in setOf(::foo2) + inv() } } fun poll83(): Flow { return flow { - val inv = ::bar4 in setOf(::foo4) - inv + val inv = ::bar4 in setOf(::foo4) + inv } } diff --git a/compiler/testData/diagnostics/tests/inference/specialCallsWithCallableReferences.kt b/compiler/testData/diagnostics/tests/inference/specialCallsWithCallableReferences.kt index 45c41ac0bbf..097eeed81d6 100644 --- a/compiler/testData/diagnostics/tests/inference/specialCallsWithCallableReferences.kt +++ b/compiler/testData/diagnostics/tests/inference/specialCallsWithCallableReferences.kt @@ -274,8 +274,8 @@ fun poll8() { } fun poll81() { - val inv = ::bar2 in setOf(::foo2) - inv() + val inv = ::bar2 in setOf(::foo2) + inv() } fun poll82() { @@ -304,7 +304,7 @@ fun poll86() { } fun poll87() { - val inv = ::Foo7 in setOf(foo7()) + val inv = ::Foo7 in setOf(foo7()) inv } diff --git a/compiler/testData/diagnostics/testsWithStdLib/cast/AsInsideIn.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/cast/AsInsideIn.fir.kt index 5e024647b09..7ed4970bc2f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/cast/AsInsideIn.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/cast/AsInsideIn.fir.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // !WITH_NEW_INFERENCE // See also KT-10386 interface A diff --git a/compiler/testData/diagnostics/testsWithStdLib/cast/AsInsideIn.kt b/compiler/testData/diagnostics/testsWithStdLib/cast/AsInsideIn.kt index d9f7ce87fcc..5936a24c965 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/cast/AsInsideIn.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/cast/AsInsideIn.kt @@ -1,4 +1,3 @@ -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // !WITH_NEW_INFERENCE // See also KT-10386 interface A diff --git a/compiler/testData/diagnostics/testsWithStdLib/commonCollections.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/commonCollections.fir.kt index 905eb9f1aa8..b9f33297b7a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/commonCollections.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/commonCollections.fir.kt @@ -1,5 +1,4 @@ // !WITH_NEW_INFERENCE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks import java.util.* fun foo() { diff --git a/compiler/testData/diagnostics/testsWithStdLib/commonCollections.kt b/compiler/testData/diagnostics/testsWithStdLib/commonCollections.kt index 361426dc751..f5f8a67df88 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/commonCollections.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/commonCollections.kt @@ -1,5 +1,4 @@ // !WITH_NEW_INFERENCE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks import java.util.* fun foo() { diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/explicitTypeArgumentAsValidInputType.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/explicitTypeArgumentAsValidInputType.fir.kt index c29c1d35cdb..c43b914ba5b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/explicitTypeArgumentAsValidInputType.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/explicitTypeArgumentAsValidInputType.fir.kt @@ -1,5 +1,4 @@ // !DIAGNOSTICS: -INVISIBLE_MEMBER -INVISIBLE_REFERENCE -UNUSED_PARAMETER -// !LANGUAGE: -NonStrictOnlyInputTypesChecks interface Parent object ChildA : Parent diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/explicitTypeArgumentAsValidInputType.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/explicitTypeArgumentAsValidInputType.kt index fb6df201d96..bddb3045bba 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/explicitTypeArgumentAsValidInputType.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/explicitTypeArgumentAsValidInputType.kt @@ -1,5 +1,4 @@ // !DIAGNOSTICS: -INVISIBLE_MEMBER -INVISIBLE_REFERENCE -UNUSED_PARAMETER -// !LANGUAGE: -NonStrictOnlyInputTypesChecks interface Parent object ChildA : Parent diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt26698.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt26698.fir.kt index 67580ab4a6e..9f21f112c23 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt26698.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt26698.fir.kt @@ -1,5 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // !WITH_NEW_INFERENCE open class Base() diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt26698.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt26698.kt index 3412d85ca5e..b4d5b204f21 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt26698.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt26698.kt @@ -1,5 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // !WITH_NEW_INFERENCE open class Base() diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt29307.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt29307.fir.kt index e9c32749674..7c83c789fa5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt29307.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt29307.fir.kt @@ -1,6 +1,5 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE // !WITH_NEW_INFERENCE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // ISSUE: KT-29307 fun test_1(map: Map) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt29307.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt29307.kt index d95d4862396..727bba14f54 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt29307.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt29307.kt @@ -1,6 +1,5 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE // !WITH_NEW_INFERENCE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // ISSUE: KT-29307 fun test_1(map: Map) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypes.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypes.fir.kt index 9ff248d429d..7419fb23089 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypes.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypes.fir.kt @@ -1,5 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // !WITH_NEW_INFERENCE @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypes.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypes.kt index 0cdccc5c916..5e68d52b698 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypes.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypes.kt @@ -1,5 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // !WITH_NEW_INFERENCE @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.fir.kt index e3f188fd452..dc723a5ed63 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.fir.kt @@ -1,6 +1,5 @@ //!DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE // !WITH_NEW_INFERENCE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") @kotlin.jvm.JvmName("containsAny") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.kt index b7ca949ae29..ce41196593b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.kt @@ -1,6 +1,5 @@ //!DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE // !WITH_NEW_INFERENCE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") @kotlin.jvm.JvmName("containsAny") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndTopLevelCapturedTypes.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndTopLevelCapturedTypes.fir.kt index 3ae41579f36..8626a66681c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndTopLevelCapturedTypes.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndTopLevelCapturedTypes.fir.kt @@ -1,5 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // !WITH_NEW_INFERENCE class Inv diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndTopLevelCapturedTypes.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndTopLevelCapturedTypes.kt index 9ac814dd9ad..a27be5e96f9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndTopLevelCapturedTypes.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndTopLevelCapturedTypes.kt @@ -1,5 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // !WITH_NEW_INFERENCE class Inv diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCaptured.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCaptured.fir.kt index 9171eea3e48..e604433ef51 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCaptured.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCaptured.fir.kt @@ -1,6 +1,5 @@ // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // Issue: KT-26698 @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCaptured.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCaptured.kt index 497171ac320..d5fd7fb922c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCaptured.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCaptured.kt @@ -1,6 +1,5 @@ // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // Issue: KT-26698 @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCommonConstraintSystem.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCommonConstraintSystem.fir.kt index f6baab762de..cfc561a8fd0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCommonConstraintSystem.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCommonConstraintSystem.fir.kt @@ -1,5 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // !WITH_NEW_INFERENCE @file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCommonConstraintSystem.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCommonConstraintSystem.kt index 149cb65f401..80fbd7071dc 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCommonConstraintSystem.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCommonConstraintSystem.kt @@ -1,5 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // !WITH_NEW_INFERENCE @file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesUpperBound.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesUpperBound.fir.kt index d7b5b2c573b..3badc12f5d1 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesUpperBound.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesUpperBound.fir.kt @@ -1,5 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // !WITH_NEW_INFERENCE @file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesUpperBound.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesUpperBound.kt index 4a26d8b6ebe..7737464f651 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesUpperBound.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesUpperBound.kt @@ -1,5 +1,4 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // !WITH_NEW_INFERENCE @file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWarning.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWarning.fir.kt index 710cf6324a2..0470d75b23b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWarning.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWarning.fir.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +NewInference +NonStrictOnlyInputTypesChecks +// !LANGUAGE: +NewInference -StrictOnlyInputTypesChecks // !DIAGNOSTICS: -UNUSED_PARAMETER @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWarning.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWarning.kt index 656304030a5..e6b33118c3b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWarning.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWarning.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +NewInference +NonStrictOnlyInputTypesChecks +// !LANGUAGE: +NewInference -StrictOnlyInputTypesChecks // !DIAGNOSTICS: -UNUSED_PARAMETER @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/resolveWithOnlyInputTypesAnnotation.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/resolveWithOnlyInputTypesAnnotation.fir.kt index f4db443205d..e81c26f8c11 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/resolveWithOnlyInputTypesAnnotation.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/resolveWithOnlyInputTypesAnnotation.fir.kt @@ -1,5 +1,4 @@ //!DIAGNOSTICS: -UNUSED_PARAMETER -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // !WITH_NEW_INFERENCE @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/resolveWithOnlyInputTypesAnnotation.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/resolveWithOnlyInputTypesAnnotation.kt index a66f670aeb8..3167214902a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/resolveWithOnlyInputTypesAnnotation.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/resolveWithOnlyInputTypesAnnotation.kt @@ -1,5 +1,4 @@ //!DIAGNOSTICS: -UNUSED_PARAMETER -// !LANGUAGE: -NonStrictOnlyInputTypesChecks // !WITH_NEW_INFERENCE @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/intersectionInputType.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/intersectionInputType.kt index 602d507134c..0b312e318b3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/intersectionInputType.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/intersectionInputType.kt @@ -8,5 +8,5 @@ fun test() { else -> 1.0 } - assertEquals(42, u) + assertEquals(42, u) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/kt36951.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt36951.kt index 18b5943deaa..c04fe988406 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt36951.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/kt36951.kt @@ -4,6 +4,6 @@ class BaseT> : HashSet() { fun foo() { - super.remove("") + super.remove("") } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContains.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContains.fir.kt index 3822790bf66..04518b17d45 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContains.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContains.fir.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: -ProhibitConcurrentHashMapContains -NonStrictOnlyInputTypesChecks +// !LANGUAGE: -ProhibitConcurrentHashMapContains // !WITH_NEW_INFERENCE // FULL_JDK diff --git a/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContains.kt b/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContains.kt index 06af709babc..fd77d66b085 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContains.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContains.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: -ProhibitConcurrentHashMapContains -NonStrictOnlyInputTypesChecks +// !LANGUAGE: -ProhibitConcurrentHashMapContains // !WITH_NEW_INFERENCE // FULL_JDK diff --git a/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContainsError.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContainsError.fir.kt index 5d66e168b78..1bb3d96ec2f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContainsError.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContainsError.fir.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +ProhibitConcurrentHashMapContains -NonStrictOnlyInputTypesChecks +// !LANGUAGE: +ProhibitConcurrentHashMapContains // !WITH_NEW_INFERENCE // FULL_JDK diff --git a/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContainsError.kt b/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContainsError.kt index d55eab781ef..1a9afcaa480 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContainsError.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContainsError.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +ProhibitConcurrentHashMapContains -NonStrictOnlyInputTypesChecks +// !LANGUAGE: +ProhibitConcurrentHashMapContains // !WITH_NEW_INFERENCE // FULL_JDK diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index b462bfdf518..9642f885f0b 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -148,6 +148,7 @@ enum class LanguageFeature( JvmIrEnabledByDefault(KOTLIN_1_5), // Disabled until the breaking change is approved by the committee, see KT-10884. PackagePrivateFileClassesWithAllPrivateMembers(KOTLIN_1_5, defaultState = State.DISABLED), + StrictOnlyInputTypesChecks(sinceVersion = KOTLIN_1_5), /* * Improvements include the following: @@ -185,7 +186,6 @@ enum class LanguageFeature( SamConversionForKotlinFunctions(sinceVersion = KOTLIN_1_4), SamConversionPerArgument(sinceVersion = KOTLIN_1_4), FunctionReferenceWithDefaultValueAsOtherType(sinceVersion = KOTLIN_1_4), - NonStrictOnlyInputTypesChecks(sinceVersion = KOTLIN_1_4), SuspendConversion(sinceVersion = KOTLIN_1_4, defaultState = State.DISABLED), UnitConversion(sinceVersion = KOTLIN_1_4, defaultState = State.DISABLED), OverloadResolutionByLambdaReturnType(sinceVersion = KOTLIN_1_4),