Disable ContracsDSL in 1.3
This commit is contained in:
+11
-1
@@ -48,7 +48,17 @@ class ContractParsingServices(val languageVersionSettings: LanguageVersionSettin
|
||||
languageVersionSettings.getFlag(AnalysisFlag.Flags.allowKotlinPackage)
|
||||
|
||||
val contractDescriptor = when {
|
||||
!isFeatureTurnedOn || !isContractDescriptionCallPreciseCheck(expression, trace.bindingContext) -> null
|
||||
!isContractDescriptionCallPreciseCheck(expression, trace.bindingContext) -> null
|
||||
|
||||
!isFeatureTurnedOn -> {
|
||||
trace.report(
|
||||
Errors.UNSUPPORTED_FEATURE.on(
|
||||
expression,
|
||||
LanguageFeature.AllowContractsForCustomFunctions to languageVersionSettings
|
||||
)
|
||||
)
|
||||
null
|
||||
}
|
||||
|
||||
!isContractAllowedHere(scope) || !isFirstStatement -> {
|
||||
trace.report(Errors.CONTRACT_NOT_ALLOWED.on(expression))
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
||||
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
|
||||
package test
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
||||
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
|
||||
package test
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
||||
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
|
||||
package test
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
||||
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
|
||||
package test
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
||||
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
|
||||
package test
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
||||
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
|
||||
package test
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
||||
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
|
||||
package test
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
||||
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
|
||||
package test
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
||||
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
|
||||
package test
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
||||
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
|
||||
package test
|
||||
|
||||
@@ -74,7 +74,6 @@ enum class LanguageFeature(
|
||||
UseReturnsEffect(KOTLIN_1_3),
|
||||
UseCallsInPlaceEffect(KOTLIN_1_3),
|
||||
VariableDeclarationInWhenSubject(KOTLIN_1_3),
|
||||
AllowContractsForCustomFunctions(KOTLIN_1_3, kind = UNSTABLE_FEATURE),
|
||||
ProhibitLocalAnnotations(KOTLIN_1_3, kind = BUG_FIX),
|
||||
ProhibitSmartcastsOnLocalDelegatedProperty(KOTLIN_1_3, kind = BUG_FIX),
|
||||
ProhibitOperatorMod(KOTLIN_1_3, kind = BUG_FIX),
|
||||
@@ -90,6 +89,8 @@ enum class LanguageFeature(
|
||||
State.ENABLED_WITH_WARNING
|
||||
),
|
||||
|
||||
AllowContractsForCustomFunctions(sinceVersion = null, defaultState = State.DISABLED, kind = UNSTABLE_FEATURE),
|
||||
|
||||
MultiPlatformProjects(sinceVersion = null, defaultState = State.DISABLED),
|
||||
|
||||
NewInference(sinceVersion = KOTLIN_1_3, defaultState = State.DISABLED),
|
||||
|
||||
Reference in New Issue
Block a user