@@ -27,7 +27,7 @@ import org.jetbrains.kotlin.fir.types.resolvedType
2727import org.jetbrains.kotlin.fir.visitors.FirDefaultVisitor
2828import org.jetbrains.kotlin.name.CallableId
2929import org.jetbrains.kotlin.name.Name
30- import org.jetbrains.kotlin.resolve.FirContractsDslNames
30+ import org.jetbrains.kotlin.resolve.ContractsDslNames
3131import org.jetbrains.kotlin.types.ConstantValueKind
3232import org.jetbrains.kotlin.utils.addToStdlib.runIf
3333import org.jetbrains.kotlin.utils.addToStdlib.shouldNotBeCalled
@@ -38,9 +38,9 @@ class ConeEffectExtractor(
3838 private val valueAndContextParameters : List <FirValueParameter >
3939) : FirDefaultVisitor<ConeContractDescriptionElement, Nothing?>(), SessionHolder {
4040 companion object {
41- private val BOOLEAN_AND = FirContractsDslNames .id(" kotlin" , " Boolean" , " and" )
42- private val BOOLEAN_OR = FirContractsDslNames .id(" kotlin" , " Boolean" , " or" )
43- private val BOOLEAN_NOT = FirContractsDslNames .id(" kotlin" , " Boolean" , " not" )
41+ private val BOOLEAN_AND = ContractsDslNames .id(" kotlin" , " Boolean" , " and" )
42+ private val BOOLEAN_OR = ContractsDslNames .id(" kotlin" , " Boolean" , " or" )
43+ private val BOOLEAN_NOT = ContractsDslNames .id(" kotlin" , " Boolean" , " not" )
4444
4545 private val LAMBDA_ARGUMENT_NAME = Name .identifier(" lambda" )
4646 private val OTHER_ARGUMENT_NAME = Name .identifier(" other" )
@@ -60,13 +60,13 @@ class ConeEffectExtractor(
6060 ? : return ConeContractDescriptionError .UnresolvedCall (functionCall.calleeReference.name).asElement()
6161
6262 return when (resolvedId) {
63- FirContractsDslNames .IMPLIES -> {
63+ ContractsDslNames .IMPLIES -> {
6464 val effect = functionCall.explicitReceiver?.asContractElement() as ? ConeEffectDeclaration ? : noReceiver(resolvedId)
6565 val condition = functionCall.argument.asContractElement() as ? ConeBooleanExpression ? : noArgument(resolvedId)
6666 ConeConditionalEffectDeclaration (effect, condition)
6767 }
6868
69- FirContractsDslNames .RETURNS -> {
69+ ContractsDslNames .RETURNS -> {
7070 val argument = functionCall.arguments.firstOrNull()
7171 val value = if (argument == null ) {
7272 ConeContractConstantValues .WILDCARD
@@ -80,11 +80,11 @@ class ConeEffectExtractor(
8080 KtReturnsEffectDeclaration (value as ConeConstantReference )
8181 }
8282
83- FirContractsDslNames .RETURNS_NOT_NULL -> {
83+ ContractsDslNames .RETURNS_NOT_NULL -> {
8484 ConeReturnsEffectDeclaration (ConeContractConstantValues .NOT_NULL )
8585 }
8686
87- FirContractsDslNames .CALLS_IN_PLACE -> {
87+ ContractsDslNames .CALLS_IN_PLACE -> {
8888 val reference = functionCall.arguments.getOrNull(0 ).asContractValueExpression(LAMBDA_ARGUMENT_NAME )
8989 when (val argument = functionCall.arguments.getOrNull(1 )) {
9090 null -> ConeCallsEffectDeclaration (reference, EventOccurrencesRange .UNKNOWN )
@@ -95,7 +95,7 @@ class ConeEffectExtractor(
9595 }
9696 }
9797
98- FirContractsDslNames .IMPLIES_BUILDER -> {
98+ ContractsDslNames .IMPLIES_BUILDER -> {
9999 if (LanguageFeature .ConditionImpliesReturnsContracts .isEnabled()) {
100100 val condition = functionCall.explicitReceiver?.asContractElement() as ? ConeBooleanExpression ? : noReceiver(resolvedId)
101101 when (val argument = functionCall.arguments.getOrNull(0 )) {
@@ -109,7 +109,7 @@ class ConeEffectExtractor(
109109 }
110110 }
111111
112- FirContractsDslNames .HOLDS_IN -> {
112+ ContractsDslNames .HOLDS_IN -> {
113113 if (LanguageFeature .HoldsInContracts .isEnabled()) {
114114 val condition = functionCall.explicitReceiver?.asContractElement() as ? ConeBooleanExpression ? : noReceiver(resolvedId)
115115 val reference = functionCall.arguments.getOrNull(0 ).asContractValueExpression(LAMBDA_ARGUMENT_NAME )
@@ -268,10 +268,10 @@ class ConeEffectExtractor(
268268 if (this !is FirQualifiedAccessExpression ) return null
269269 val resolvedId = toResolvedCallableSymbol(session)?.callableId ? : return null
270270 return when (resolvedId) {
271- FirContractsDslNames .EXACTLY_ONCE_KIND -> EventOccurrencesRange .EXACTLY_ONCE
272- FirContractsDslNames .AT_LEAST_ONCE_KIND -> EventOccurrencesRange .AT_LEAST_ONCE
273- FirContractsDslNames .AT_MOST_ONCE_KIND -> EventOccurrencesRange .AT_MOST_ONCE
274- FirContractsDslNames .UNKNOWN_KIND -> EventOccurrencesRange .UNKNOWN
271+ ContractsDslNames .EXACTLY_ONCE_KIND -> EventOccurrencesRange .EXACTLY_ONCE
272+ ContractsDslNames .AT_LEAST_ONCE_KIND -> EventOccurrencesRange .AT_LEAST_ONCE
273+ ContractsDslNames .AT_MOST_ONCE_KIND -> EventOccurrencesRange .AT_MOST_ONCE
274+ ContractsDslNames .UNKNOWN_KIND -> EventOccurrencesRange .UNKNOWN
275275 else -> null
276276 }
277277 }
0 commit comments