mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
[kotlin-dfa] Merge util.kt into KtDfaHelpers.kt
Preparatory step for KTIJ-28908 Convert "Constant conditions" inspection to K2 GitOrigin-RevId: 3199cae9b73d29269d4a998c588cc5ad91d69a3c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
82adcad423
commit
d7501472cd
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.builtins.StandardNames.FqNames
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.resolveToCall
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.safeAnalyzeNonSourceRootCode
|
||||
import org.jetbrains.kotlin.idea.codeInsight.hints.RangeKtExpressionType
|
||||
import org.jetbrains.kotlin.lexer.KtTokens
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.resolve.bindingContextUtil.getAbbreviatedTypeOrType
|
||||
@@ -263,4 +264,11 @@ internal fun getInlineableLambda(expr: KtCallExpression): LambdaAndParameter? {
|
||||
return LambdaAndParameter(lambdaExpression, parameterDescriptor)
|
||||
}
|
||||
|
||||
internal data class LambdaAndParameter(val lambda: KtLambdaExpression, val descriptor: ValueParameterDescriptor)
|
||||
internal data class LambdaAndParameter(val lambda: KtLambdaExpression, val descriptor: ValueParameterDescriptor)
|
||||
|
||||
internal fun RangeKtExpressionType.getRelationType() =
|
||||
when (this) {
|
||||
RangeKtExpressionType.RANGE_TO -> RelationType.GE to RelationType.LE
|
||||
RangeKtExpressionType.RANGE_UNTIL, RangeKtExpressionType.UNTIL -> RelationType.GE to RelationType.LT
|
||||
RangeKtExpressionType.DOWN_TO -> RelationType.LE to RelationType.GE
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.kotlin.idea.inspections.dfa
|
||||
|
||||
import com.intellij.codeInspection.dataFlow.value.RelationType
|
||||
import org.jetbrains.kotlin.idea.codeInsight.hints.RangeKtExpressionType
|
||||
import org.jetbrains.kotlin.idea.codeInsight.hints.RangeKtExpressionType.*
|
||||
|
||||
fun RangeKtExpressionType.getRelationType() =
|
||||
when (this) {
|
||||
RANGE_TO -> RelationType.GE to RelationType.LE
|
||||
RANGE_UNTIL, UNTIL -> RelationType.GE to RelationType.LT
|
||||
DOWN_TO -> RelationType.LE to RelationType.GE
|
||||
}
|
||||
Reference in New Issue
Block a user