From 802272a579312383132f81aa504a9172c7e07236 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Mon, 8 Jun 2020 16:58:43 +0300 Subject: [PATCH] Enable `ContractsOnCallsWithImplicitReceiver` in 1.4 #KT-28672 Fixed --- .../contracts/smartcasts/extensionReceiver.fir.kt | 2 +- .../testsWithStdLib/contracts/smartcasts/extensionReceiver.kt | 2 +- .../src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver.fir.kt index 809b6ab375b..deb0801d3fc 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver.fir.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +AllowContractsForCustomFunctions +UseReturnsEffect +// !LANGUAGE: +AllowContractsForCustomFunctions +UseReturnsEffect -ContractsOnCallsWithImplicitReceiver // !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts // !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER // diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver.kt index f34b254d12c..c4af95ceeab 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +AllowContractsForCustomFunctions +UseReturnsEffect +// !LANGUAGE: +AllowContractsForCustomFunctions +UseReturnsEffect -ContractsOnCallsWithImplicitReceiver // !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts // !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER // diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index 7007f131a75..84763cf7832 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -155,6 +155,7 @@ enum class LanguageFeature( SuspendConversion(sinceVersion = KOTLIN_1_4, defaultState = State.DISABLED), UnitConversion(sinceVersion = KOTLIN_1_4, defaultState = State.DISABLED), OverloadResolutionByLambdaReturnType(sinceVersion = KOTLIN_1_4), + ContractsOnCallsWithImplicitReceiver(sinceVersion = KOTLIN_1_4), BooleanElvisBoundSmartCasts(sinceVersion = KOTLIN_1_3, defaultState = State.DISABLED), // see KT-26357 for details NewDataFlowForTryExpressions(sinceVersion = KOTLIN_1_4, defaultState = State.DISABLED), @@ -163,8 +164,6 @@ enum class LanguageFeature( // Next features can be enabled regardless of new inference InlineClasses(sinceVersion = KOTLIN_1_3, defaultState = State.ENABLED_WITH_WARNING, kind = UNSTABLE_FEATURE), - - ContractsOnCallsWithImplicitReceiver(sinceVersion = KOTLIN_1_3, defaultState = State.DISABLED), ; val presentableName: String