[kotlin] Provide CFG facade for the extract function refactoring
This is the first implementation of a control flow graph facade for the extract function IDE refactoring. The exact contents of 'KtDataFlowExitPointSnapshot' will be refined later. ^KT-65762 Fixed
This commit is contained in:
+1
@@ -64,6 +64,7 @@ class KtFe10AnalysisSession(
|
|||||||
override val symbolProviderByJavaPsiImpl: KtSymbolProviderByJavaPsi = KtFe10SymbolProviderByJavaPsi(this)
|
override val symbolProviderByJavaPsiImpl: KtSymbolProviderByJavaPsi = KtFe10SymbolProviderByJavaPsi(this)
|
||||||
override val resolveExtensionInfoProviderImpl: KtResolveExtensionInfoProvider = KtFe10ResolveExtensionInfoProvider(this)
|
override val resolveExtensionInfoProviderImpl: KtResolveExtensionInfoProvider = KtFe10ResolveExtensionInfoProvider(this)
|
||||||
override val compilerFacilityImpl: KtCompilerFacility = KtFe10CompilerFacility(this)
|
override val compilerFacilityImpl: KtCompilerFacility = KtFe10CompilerFacility(this)
|
||||||
|
override val dataFlowInfoProviderImpl: KtDataFlowInfoProvider = KtFe10DataFlowInfoProvider(this)
|
||||||
|
|
||||||
override val metadataCalculatorImpl: KtMetadataCalculator
|
override val metadataCalculatorImpl: KtMetadataCalculator
|
||||||
get() = throw NotSupportedForK1Exception()
|
get() = throw NotSupportedForK1Exception()
|
||||||
|
|||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.analysis.api.descriptors.components
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.analysis.api.KtAnalysisNonPublicApi
|
||||||
|
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
|
||||||
|
import org.jetbrains.kotlin.analysis.api.components.KtDataFlowExitPointSnapshot
|
||||||
|
import org.jetbrains.kotlin.analysis.api.components.KtDataFlowInfoProvider
|
||||||
|
import org.jetbrains.kotlin.psi.KtExpression
|
||||||
|
|
||||||
|
@OptIn(KtAnalysisNonPublicApi::class)
|
||||||
|
internal class KtFe10DataFlowInfoProvider(override val analysisSession: KtAnalysisSession) : KtDataFlowInfoProvider() {
|
||||||
|
override fun getExitPointSnapshot(statements: List<KtExpression>): KtDataFlowExitPointSnapshot {
|
||||||
|
throw NotImplementedError("Method is not implemented for FE 1.0")
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
@@ -126,6 +126,8 @@ private constructor(
|
|||||||
|
|
||||||
override val substitutorProviderImpl: KtSubstitutorProvider = KtFirSubstitutorProvider(this)
|
override val substitutorProviderImpl: KtSubstitutorProvider = KtFirSubstitutorProvider(this)
|
||||||
|
|
||||||
|
override val dataFlowInfoProviderImpl: KtDataFlowInfoProvider = KtFirDataFlowInfoProvider(this)
|
||||||
|
|
||||||
internal val useSiteSession: FirSession get() = firResolveSession.useSiteFirSession
|
internal val useSiteSession: FirSession get() = firResolveSession.useSiteFirSession
|
||||||
internal val firSymbolProvider: FirSymbolProvider get() = useSiteSession.symbolProvider
|
internal val firSymbolProvider: FirSymbolProvider get() = useSiteSession.symbolProvider
|
||||||
internal val targetPlatform: TargetPlatform get() = useSiteSession.moduleData.platform
|
internal val targetPlatform: TargetPlatform get() = useSiteSession.moduleData.platform
|
||||||
|
|||||||
+376
@@ -0,0 +1,376 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.analysis.api.fir.components
|
||||||
|
|
||||||
|
import com.intellij.psi.util.PsiTreeUtil
|
||||||
|
import org.jetbrains.kotlin.KtFakeSourceElementKind.*
|
||||||
|
import org.jetbrains.kotlin.analysis.api.KtAnalysisNonPublicApi
|
||||||
|
import org.jetbrains.kotlin.analysis.api.components.KtDataFlowExitPointSnapshot
|
||||||
|
import org.jetbrains.kotlin.analysis.api.components.KtDataFlowExitPointSnapshot.VariableReassignment
|
||||||
|
import org.jetbrains.kotlin.analysis.api.components.KtDataFlowInfoProvider
|
||||||
|
import org.jetbrains.kotlin.analysis.api.fir.KtFirAnalysisSession
|
||||||
|
import org.jetbrains.kotlin.analysis.api.fir.utils.unwrap
|
||||||
|
import org.jetbrains.kotlin.analysis.api.types.KtType
|
||||||
|
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.getOrBuildFir
|
||||||
|
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.getOrBuildFirOfType
|
||||||
|
import org.jetbrains.kotlin.analysis.utils.errors.withKtModuleEntry
|
||||||
|
import org.jetbrains.kotlin.analysis.utils.printer.parentsOfType
|
||||||
|
import org.jetbrains.kotlin.fir.FirElement
|
||||||
|
import org.jetbrains.kotlin.fir.analysis.checkers.declaration.isLocalMember
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirAnonymousFunction
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirConstructor
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirControlFlowGraphOwner
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirErrorFunction
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirErrorPrimaryConstructor
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirFunction
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirPropertyAccessor
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirBlock
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirBreakExpression
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirContinueExpression
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirErrorExpression
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirJump
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirLoop
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirReturnExpression
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirThrowExpression
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirVariableAssignment
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.impl.FirUnitExpression
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.toResolvedCallableSymbol
|
||||||
|
import org.jetbrains.kotlin.fir.psi
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.AnonymousObjectExpressionExitNode
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.CFGNode
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.CFGNodeWithSubgraphs
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.ControlFlowGraph
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.DelegateExpressionExitNode
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.ElvisExitNode
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.ElvisLhsExitNode
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.ExitNodeMarker
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.ExitSafeCallNode
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.ExitValueParameterNode
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.LocalClassExitNode
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.PostponedLambdaExitNode
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.SmartCastExpressionExitNode
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.StubNode
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.WhenBranchResultExitNode
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.cfg.WhenSubjectExpressionExitNode
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.dfa.controlFlowGraph
|
||||||
|
import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol
|
||||||
|
import org.jetbrains.kotlin.fir.types.ConeKotlinType
|
||||||
|
import org.jetbrains.kotlin.fir.types.commonSuperTypeOrNull
|
||||||
|
import org.jetbrains.kotlin.fir.types.isNothing
|
||||||
|
import org.jetbrains.kotlin.fir.types.isUnit
|
||||||
|
import org.jetbrains.kotlin.fir.types.resolvedType
|
||||||
|
import org.jetbrains.kotlin.fir.types.typeContext
|
||||||
|
import org.jetbrains.kotlin.fir.utils.exceptions.withFirEntry
|
||||||
|
import org.jetbrains.kotlin.fir.visitors.FirDefaultVisitorVoid
|
||||||
|
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||||
|
import org.jetbrains.kotlin.psi.KtElement
|
||||||
|
import org.jetbrains.kotlin.psi.KtExpression
|
||||||
|
import org.jetbrains.kotlin.psi.KtReturnExpression
|
||||||
|
import org.jetbrains.kotlin.utils.exceptions.errorWithAttachment
|
||||||
|
import org.jetbrains.kotlin.utils.exceptions.withPsiEntry
|
||||||
|
import java.util.ArrayList
|
||||||
|
import kotlin.math.sign
|
||||||
|
|
||||||
|
@OptIn(KtAnalysisNonPublicApi::class)
|
||||||
|
internal class KtFirDataFlowInfoProvider(override val analysisSession: KtFirAnalysisSession) : KtDataFlowInfoProvider() {
|
||||||
|
override fun getExitPointSnapshot(statements: List<KtExpression>): KtDataFlowExitPointSnapshot {
|
||||||
|
require(statements.isNotEmpty())
|
||||||
|
require(haveCommonParent(statements))
|
||||||
|
|
||||||
|
val firResolveSession = analysisSession.firResolveSession
|
||||||
|
|
||||||
|
val firStatements = statements.map { it.unwrap().getOrBuildFirOfType<FirElement>(firResolveSession) }
|
||||||
|
|
||||||
|
val collector = FirElementCollector()
|
||||||
|
firStatements.forEach { it.accept(collector) }
|
||||||
|
|
||||||
|
val firValuedReturnExpressions = collector.firReturnExpressions.filter { !it.result.resolvedType.isUnit }
|
||||||
|
|
||||||
|
val firDefaultStatement = firStatements.last()
|
||||||
|
val defaultExpressionInfo = computeDefaultExpression(statements, firDefaultStatement)
|
||||||
|
|
||||||
|
val firEscapingCandidates = buildSet<FirElement> {
|
||||||
|
add(firDefaultStatement)
|
||||||
|
addAll(collector.firReturnExpressions)
|
||||||
|
addAll(collector.firBreakExpressions)
|
||||||
|
addAll(collector.firContinueExpressions)
|
||||||
|
}
|
||||||
|
|
||||||
|
val hasEscapingJumps = computeHasEscapingJumps(statements.first(), firStatements.first(), firEscapingCandidates)
|
||||||
|
|
||||||
|
val loopJumpExpressions = ArrayList<KtExpression>(collector.firBreakExpressions.size + collector.firContinueExpressions.size)
|
||||||
|
collector.firBreakExpressions.mapNotNullTo(loopJumpExpressions) { it.psi as? KtExpression }
|
||||||
|
collector.firContinueExpressions.mapNotNullTo(loopJumpExpressions) { it.psi as? KtExpression }
|
||||||
|
|
||||||
|
return KtDataFlowExitPointSnapshot(
|
||||||
|
defaultExpressionInfo = defaultExpressionInfo,
|
||||||
|
valuedReturnExpressions = firValuedReturnExpressions.mapNotNull { it.psi as? KtReturnExpression },
|
||||||
|
returnValueType = computeReturnType(firValuedReturnExpressions),
|
||||||
|
loopJumpExpressions = loopJumpExpressions,
|
||||||
|
hasJumps = collector.hasJumps,
|
||||||
|
hasEscapingJumps = hasEscapingJumps,
|
||||||
|
hasMultipleJumpKinds = collector.hasMultipleJumpKinds,
|
||||||
|
hasMultipleJumpTargets = collector.hasMultipleJumpTargets,
|
||||||
|
variableReassignments = collector.variableReassignments
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun haveCommonParent(statements: List<KtElement>): Boolean {
|
||||||
|
if (statements.size < 2) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
val parent = statements.first().parent
|
||||||
|
return statements.all { it.parent == parent }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun computeDefaultExpression(
|
||||||
|
statements: List<KtExpression>,
|
||||||
|
firDefaultStatement: FirElement
|
||||||
|
): KtDataFlowExitPointSnapshot.DefaultExpressionInfo? {
|
||||||
|
when (firDefaultStatement) {
|
||||||
|
!is FirExpression,
|
||||||
|
is FirJump<*>,
|
||||||
|
is FirBlock,
|
||||||
|
is FirThrowExpression,
|
||||||
|
is FirResolvedQualifier,
|
||||||
|
is FirUnitExpression,
|
||||||
|
is FirErrorExpression -> {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Suppress("USELESS_IS_CHECK") // K2 warning suppression, TODO: KT-62472
|
||||||
|
require(firDefaultStatement is FirExpression)
|
||||||
|
|
||||||
|
val defaultExpressionFromPsi = statements.last()
|
||||||
|
val defaultExpressionFromFir = firDefaultStatement.psi as? KtExpression ?: return null
|
||||||
|
|
||||||
|
if (!PsiTreeUtil.isAncestor(defaultExpressionFromFir, defaultExpressionFromPsi, false)) {
|
||||||
|
// In certain cases, expressions might be different in PSI and FIR sources.
|
||||||
|
// E.g., in 'foo.<expr>bar()</expr>', there is no FIR expression that corresponds to the 'bar()' KtCallExpression.
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
val defaultConeType = firDefaultStatement.resolvedType
|
||||||
|
if (defaultConeType.isNothing) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
val defaultType = defaultConeType.toKtType()
|
||||||
|
return KtDataFlowExitPointSnapshot.DefaultExpressionInfo(defaultExpressionFromPsi, defaultType)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun computeReturnType(firReturnExpressions: List<FirReturnExpression>): KtType? {
|
||||||
|
val coneTypes = ArrayList<ConeKotlinType>(firReturnExpressions.size)
|
||||||
|
|
||||||
|
for (firReturnExpression in firReturnExpressions) {
|
||||||
|
val coneType = firReturnExpression.result.resolvedType
|
||||||
|
if (coneType.isUnit) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
coneTypes.add(coneType)
|
||||||
|
}
|
||||||
|
|
||||||
|
return analysisSession.useSiteSession.typeContext.commonSuperTypeOrNull(coneTypes)?.toKtType()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun computeHasEscapingJumps(anchor: KtElement, firAnchor: FirElement, firTargets: Set<FirElement>): Boolean {
|
||||||
|
if (firTargets.size < 2) {
|
||||||
|
// There should be both a default expression and some kind of jump
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
val graph = findControlFlowGraph(anchor, firAnchor)
|
||||||
|
?: errorWithAttachment("Cannot find a control flow graph for element") {
|
||||||
|
withKtModuleEntry("module", analysisSession.useSiteModule)
|
||||||
|
withPsiEntry("anchor", anchor)
|
||||||
|
withFirEntry("firAnchor", firAnchor)
|
||||||
|
}
|
||||||
|
|
||||||
|
val exitNodes = HashMap<FirElement, List<CFGNode<*>>>()
|
||||||
|
graph.collectExitNodes(firTargets, exitNodes)
|
||||||
|
|
||||||
|
return exitNodes.values.distinct().size > 1
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun findControlFlowGraph(anchor: KtElement, firAnchor: FirElement): ControlFlowGraph? {
|
||||||
|
val parentDeclarations = anchor.parentsOfType<KtDeclaration>(withSelf = false)
|
||||||
|
for (parentDeclaration in parentDeclarations) {
|
||||||
|
val parentFirDeclaration = parentDeclaration.getOrBuildFir(analysisSession.firResolveSession)
|
||||||
|
if (parentFirDeclaration is FirControlFlowGraphOwner) {
|
||||||
|
val graph = parentFirDeclaration.controlFlowGraphReference?.controlFlowGraph
|
||||||
|
if (graph != null && firAnchor in graph) {
|
||||||
|
return graph
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun ControlFlowGraph.collectExitNodes(firTargets: Set<FirElement>, exitNodes: MutableMap<FirElement, List<CFGNode<*>>>) {
|
||||||
|
for (node in nodes) {
|
||||||
|
val fir = node.fir
|
||||||
|
if (fir in firTargets) {
|
||||||
|
// This intentionally replaces existing values, in case if there are multiple nodes with the same FirElement.
|
||||||
|
// Here we look for exits, so we are interested in the last matching node.
|
||||||
|
exitNodes[fir] = node.followingNodes
|
||||||
|
.filter { it !is StubNode }
|
||||||
|
.map { it.unwrap() }
|
||||||
|
.distinct()
|
||||||
|
.sortedBy { it.id }
|
||||||
|
}
|
||||||
|
if (node is CFGNodeWithSubgraphs<*>) {
|
||||||
|
for (subGraph in node.subGraphs) {
|
||||||
|
subGraph.collectExitNodes(firTargets, exitNodes)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun CFGNode<*>.unwrap(): CFGNode<*> {
|
||||||
|
var current = this
|
||||||
|
|
||||||
|
while (current.isExitNode()) {
|
||||||
|
val following = current.followingNodes
|
||||||
|
if (following.size == 1) {
|
||||||
|
current = following.first()
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return current
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun CFGNode<*>.isExitNode(): Boolean {
|
||||||
|
return when (this) {
|
||||||
|
is ExitNodeMarker, is ExitValueParameterNode, is WhenSubjectExpressionExitNode, is AnonymousObjectExpressionExitNode,
|
||||||
|
is SmartCastExpressionExitNode, is PostponedLambdaExitNode, is DelegateExpressionExitNode, is WhenBranchResultExitNode,
|
||||||
|
is ElvisExitNode, is ExitSafeCallNode, is LocalClassExitNode, is ElvisLhsExitNode -> {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private operator fun ControlFlowGraph.contains(fir: FirElement): Boolean {
|
||||||
|
for (node in nodes) {
|
||||||
|
if (node.fir == fir) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (node is CFGNodeWithSubgraphs<*> && node.subGraphs.any { fir in it }) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
private inner class FirElementCollector : FirDefaultVisitorVoid() {
|
||||||
|
val hasJumps: Boolean
|
||||||
|
get() = firReturnTargets.isNotEmpty() || firLoopJumpTargets.isNotEmpty()
|
||||||
|
|
||||||
|
val hasMultipleJumpKinds: Boolean
|
||||||
|
get() = (firReturnExpressions.size.sign + firBreakExpressions.size.sign + firContinueExpressions.size.sign) > 1
|
||||||
|
|
||||||
|
val hasMultipleJumpTargets: Boolean
|
||||||
|
get() = (firReturnTargets.size + firLoopJumpTargets.size) > 1
|
||||||
|
|
||||||
|
val variableReassignments = mutableListOf<VariableReassignment>()
|
||||||
|
|
||||||
|
val firReturnExpressions = mutableListOf<FirReturnExpression>()
|
||||||
|
val firBreakExpressions = mutableListOf<FirBreakExpression>()
|
||||||
|
val firContinueExpressions = mutableListOf<FirContinueExpression>()
|
||||||
|
|
||||||
|
private val firReturnTargets = mutableSetOf<FirFunction>()
|
||||||
|
private val firLoopJumpTargets = mutableSetOf<FirLoop>()
|
||||||
|
|
||||||
|
private val firFunctionDeclarations = mutableSetOf<FirFunction>()
|
||||||
|
private val firLoopStatements = mutableSetOf<FirLoop>()
|
||||||
|
|
||||||
|
override fun visitElement(element: FirElement) {
|
||||||
|
element.acceptChildren(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visitAnonymousFunction(anonymousFunction: FirAnonymousFunction) = visitFunction(anonymousFunction)
|
||||||
|
override fun visitPropertyAccessor(propertyAccessor: FirPropertyAccessor) = visitFunction(propertyAccessor)
|
||||||
|
override fun visitSimpleFunction(simpleFunction: FirSimpleFunction) = visitFunction(simpleFunction)
|
||||||
|
override fun visitErrorFunction(errorFunction: FirErrorFunction) = visitFunction(errorFunction)
|
||||||
|
override fun visitConstructor(constructor: FirConstructor) = visitFunction(constructor)
|
||||||
|
override fun visitErrorPrimaryConstructor(errorPrimaryConstructor: FirErrorPrimaryConstructor) = visitFunction(errorPrimaryConstructor)
|
||||||
|
|
||||||
|
override fun visitFunction(function: FirFunction) {
|
||||||
|
firFunctionDeclarations.add(function)
|
||||||
|
super.visitFunction(function)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visitLoop(loop: FirLoop) {
|
||||||
|
firLoopStatements.add(loop)
|
||||||
|
super.visitLoop(loop)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visitReturnExpression(returnExpression: FirReturnExpression) {
|
||||||
|
if (returnExpression.target.labeledElement !in firFunctionDeclarations) {
|
||||||
|
firReturnExpressions.add(returnExpression)
|
||||||
|
firReturnTargets.add(returnExpression.target.labeledElement)
|
||||||
|
}
|
||||||
|
super.visitReturnExpression(returnExpression)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visitBreakExpression(breakExpression: FirBreakExpression) {
|
||||||
|
if (breakExpression.target.labeledElement !in firLoopStatements) {
|
||||||
|
firBreakExpressions.add(breakExpression)
|
||||||
|
firLoopJumpTargets.add(breakExpression.target.labeledElement)
|
||||||
|
}
|
||||||
|
super.visitBreakExpression(breakExpression)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visitContinueExpression(continueExpression: FirContinueExpression) {
|
||||||
|
if (continueExpression.target.labeledElement !in firLoopStatements) {
|
||||||
|
firContinueExpressions.add(continueExpression)
|
||||||
|
firLoopJumpTargets.add(continueExpression.target.labeledElement)
|
||||||
|
}
|
||||||
|
super.visitContinueExpression(continueExpression)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visitVariableAssignment(variableAssignment: FirVariableAssignment) {
|
||||||
|
val firVariableSymbol = variableAssignment.lValue.toResolvedCallableSymbol(analysisSession.useSiteSession)
|
||||||
|
val expression = variableAssignment.psi as? KtExpression
|
||||||
|
|
||||||
|
if (firVariableSymbol is FirVariableSymbol<*> && firVariableSymbol.fir.isLocalMember && expression != null) {
|
||||||
|
val variableSymbol = analysisSession.firSymbolBuilder.variableLikeBuilder.buildVariableLikeSymbol(firVariableSymbol)
|
||||||
|
val reassignment = VariableReassignment(expression, variableSymbol, variableAssignment.isAugmented())
|
||||||
|
variableReassignments.add(reassignment)
|
||||||
|
}
|
||||||
|
|
||||||
|
super.visitVariableAssignment(variableAssignment)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun FirVariableAssignment.isAugmented(): Boolean {
|
||||||
|
val targetSource = lValue.source
|
||||||
|
if (targetSource != null) {
|
||||||
|
when (targetSource.kind) {
|
||||||
|
is DesugaredCompoundAssignment, is DesugaredIncrementOrDecrement -> return true
|
||||||
|
else -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun ConeKotlinType.toKtType(): KtType {
|
||||||
|
return analysisSession.firSymbolBuilder.typeBuilder.buildKtType(this)
|
||||||
|
}
|
||||||
|
}
|
||||||
+138
@@ -0,0 +1,138 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.analysis.api.fir.test.cases.generated.cases.components.dataFlowInfoProvider;
|
||||||
|
|
||||||
|
import com.intellij.testFramework.TestDataPath;
|
||||||
|
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.kotlin.analysis.api.fir.test.configurators.AnalysisApiFirTestConfiguratorFactory;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode;
|
||||||
|
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.dataFlowInfoProvider.AbstractExitPointSnapshotTest;
|
||||||
|
import org.jetbrains.kotlin.test.TestMetadata;
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.analysis.api.GenerateAnalysisApiTestsKt}. DO NOT MODIFY MANUALLY */
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class FirIdeDependentAnalysisScriptSourceModuleExitPointSnapshotTestGenerated extends AbstractExitPointSnapshotTest {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public AnalysisApiTestConfigurator getConfigurator() {
|
||||||
|
return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator(
|
||||||
|
new AnalysisApiTestConfiguratorFactoryData(
|
||||||
|
FrontendKind.Fir,
|
||||||
|
TestModuleKind.ScriptSource,
|
||||||
|
AnalysisSessionMode.Dependent,
|
||||||
|
AnalysisApiMode.Ide
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInExitPointSnapshot() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ControlFlow {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInControlFlow() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ConditionalJumps {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInConditionalJumps() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class DefiniteJumps {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDefiniteJumps() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class DifferentTargets {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDifferentTargets() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ExitPointEquivalence {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInExitPointEquivalence() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class UnconditionalJumps {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInUnconditionalJumps() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class DefaultValues {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDefaultValues() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class LanguageConstructs {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInLanguageConstructs() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Variables {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInVariables() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+594
@@ -0,0 +1,594 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.analysis.api.fir.test.cases.generated.cases.components.dataFlowInfoProvider;
|
||||||
|
|
||||||
|
import com.intellij.testFramework.TestDataPath;
|
||||||
|
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.kotlin.analysis.api.fir.test.configurators.AnalysisApiFirTestConfiguratorFactory;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode;
|
||||||
|
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.dataFlowInfoProvider.AbstractExitPointSnapshotTest;
|
||||||
|
import org.jetbrains.kotlin.test.TestMetadata;
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.analysis.api.GenerateAnalysisApiTestsKt}. DO NOT MODIFY MANUALLY */
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class FirIdeDependentAnalysisSourceModuleExitPointSnapshotTestGenerated extends AbstractExitPointSnapshotTest {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public AnalysisApiTestConfigurator getConfigurator() {
|
||||||
|
return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator(
|
||||||
|
new AnalysisApiTestConfiguratorFactoryData(
|
||||||
|
FrontendKind.Fir,
|
||||||
|
TestModuleKind.Source,
|
||||||
|
AnalysisSessionMode.Dependent,
|
||||||
|
AnalysisApiMode.Ide
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInExitPointSnapshot() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ControlFlow {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInControlFlow() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("breakContinue.kt")
|
||||||
|
public void testBreakContinue() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/breakContinue.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("breakReturn.kt")
|
||||||
|
public void testBreakReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/breakReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("breakReturn2.kt")
|
||||||
|
public void testBreakReturn2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/breakReturn2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("continueReturn.kt")
|
||||||
|
public void testContinueReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/continueReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("continueReturn2.kt")
|
||||||
|
public void testContinueReturn2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/continueReturn2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultTryCatch.kt")
|
||||||
|
public void testDefaultTryCatch() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/defaultTryCatch.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultTryCatch2.kt")
|
||||||
|
public void testDefaultTryCatch2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/defaultTryCatch2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ConditionalJumps {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInConditionalJumps() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break.kt")
|
||||||
|
public void testBreak() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/break.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break2.kt")
|
||||||
|
public void testBreak2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/break2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break3.kt")
|
||||||
|
public void testBreak3() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/break3.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break4.kt")
|
||||||
|
public void testBreak4() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/break4.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break5.kt")
|
||||||
|
public void testBreak5() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/break5.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return.kt")
|
||||||
|
public void testReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/return.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return2.kt")
|
||||||
|
public void testReturn2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/return2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return3.kt")
|
||||||
|
public void testReturn3() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/return3.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class DefiniteJumps {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDefiniteJumps() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return.kt")
|
||||||
|
public void testReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps/return.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return2.kt")
|
||||||
|
public void testReturn2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps/return2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return3.kt")
|
||||||
|
public void testReturn3() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps/return3.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return4.kt")
|
||||||
|
public void testReturn4() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps/return4.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class DifferentTargets {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDifferentTargets() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break.kt")
|
||||||
|
public void testBreak() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets/break.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return.kt")
|
||||||
|
public void testReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets/return.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ExitPointEquivalence {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInExitPointEquivalence() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("breakAndReturn.kt")
|
||||||
|
public void testBreakAndReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/breakAndReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("breakContinueAndDefault.kt")
|
||||||
|
public void testBreakContinueAndDefault() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/breakContinueAndDefault.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("continueAndReturn.kt")
|
||||||
|
public void testContinueAndReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/continueAndReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultAndBreak.kt")
|
||||||
|
public void testDefaultAndBreak() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/defaultAndBreak.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultAndContinue.kt")
|
||||||
|
public void testDefaultAndContinue() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/defaultAndContinue.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultAndReturn.kt")
|
||||||
|
public void testDefaultAndReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/defaultAndReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultAndReturnInWhen.kt")
|
||||||
|
public void testDefaultAndReturnInWhen() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/defaultAndReturnInWhen.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultAndReturnInWhen2.kt")
|
||||||
|
public void testDefaultAndReturnInWhen2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/defaultAndReturnInWhen2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("multipleBreaks.kt")
|
||||||
|
public void testMultipleBreaks() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/multipleBreaks.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class UnconditionalJumps {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInUnconditionalJumps() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break.kt")
|
||||||
|
public void testBreak() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps/break.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break2.kt")
|
||||||
|
public void testBreak2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps/break2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break3.kt")
|
||||||
|
public void testBreak3() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps/break3.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break4.kt")
|
||||||
|
public void testBreak4() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps/break4.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class DefaultValues {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDefaultValues() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("anonymousFunction.kt")
|
||||||
|
public void testAnonymousFunction() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/anonymousFunction.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("anonymousObject.kt")
|
||||||
|
public void testAnonymousObject() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/anonymousObject.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("assignmentTarget.kt")
|
||||||
|
public void testAssignmentTarget() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/assignmentTarget.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("assignmentValue.kt")
|
||||||
|
public void testAssignmentValue() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/assignmentValue.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("calleeExpression.kt")
|
||||||
|
public void testCalleeExpression() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/calleeExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("errorDefaultType.kt")
|
||||||
|
public void testErrorDefaultType() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/errorDefaultType.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("expressionBlock.kt")
|
||||||
|
public void testExpressionBlock() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/expressionBlock.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("flexibleDefaultType.kt")
|
||||||
|
public void testFlexibleDefaultType() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/flexibleDefaultType.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("functionBodyBlock.kt")
|
||||||
|
public void testFunctionBodyBlock() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/functionBodyBlock.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("functionCall.kt")
|
||||||
|
public void testFunctionCall() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/functionCall.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("infixOperator.kt")
|
||||||
|
public void testInfixOperator() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/infixOperator.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("lambdaExpression.kt")
|
||||||
|
public void testLambdaExpression() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/lambdaExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("nullableDefaultType.kt")
|
||||||
|
public void testNullableDefaultType() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/nullableDefaultType.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("packageQualifier.kt")
|
||||||
|
public void testPackageQualifier() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/packageQualifier.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("singleTypedExpression.kt")
|
||||||
|
public void testSingleTypedExpression() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/singleTypedExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("suspendFunctionCall.kt")
|
||||||
|
public void testSuspendFunctionCall() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/suspendFunctionCall.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("typeQualifier.kt")
|
||||||
|
public void testTypeQualifier() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/typeQualifier.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("variableDeclaration.kt")
|
||||||
|
public void testVariableDeclaration() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/variableDeclaration.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("while.kt")
|
||||||
|
public void testWhile() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/while.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class LanguageConstructs {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInLanguageConstructs() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("arrayLiteral.kt")
|
||||||
|
public void testArrayLiteral() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/arrayLiteral.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("labeledReturn.kt")
|
||||||
|
public void testLabeledReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/labeledReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("nonLocalReturn.kt")
|
||||||
|
public void testNonLocalReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/nonLocalReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("nonLocalReturn2.kt")
|
||||||
|
public void testNonLocalReturn2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/nonLocalReturn2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("parameter.kt")
|
||||||
|
public void testParameter() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/parameter.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("parameterDefaultValue.kt")
|
||||||
|
public void testParameterDefaultValue() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/parameterDefaultValue.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return.kt")
|
||||||
|
public void testReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/return.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("trailingSemicolon.kt")
|
||||||
|
public void testTrailingSemicolon() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/trailingSemicolon.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Variables {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInVariables() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("arrayElementAugmentedReassignment.kt")
|
||||||
|
public void testArrayElementAugmentedReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/arrayElementAugmentedReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("arrayElementIncrementPostfix.kt")
|
||||||
|
public void testArrayElementIncrementPostfix() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/arrayElementIncrementPostfix.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("arrayElementIncrementPrefix.kt")
|
||||||
|
public void testArrayElementIncrementPrefix() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/arrayElementIncrementPrefix.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("augmentedReassignment.kt")
|
||||||
|
public void testAugmentedReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/augmentedReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("classPropertyReassignment.kt")
|
||||||
|
public void testClassPropertyReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/classPropertyReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("conditionalReassignment.kt")
|
||||||
|
public void testConditionalReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/conditionalReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("destructuredReassignment.kt")
|
||||||
|
public void testDestructuredReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/destructuredReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("errorTargetReassignment.kt")
|
||||||
|
public void testErrorTargetReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/errorTargetReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("incrementPostfix.kt")
|
||||||
|
public void testIncrementPostfix() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/incrementPostfix.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("incrementPrefix.kt")
|
||||||
|
public void testIncrementPrefix() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/incrementPrefix.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("lambdaParameterReassignment.kt")
|
||||||
|
public void testLambdaParameterReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/lambdaParameterReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("localVariable.kt")
|
||||||
|
public void testLocalVariable() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/localVariable.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("parameterReassignment.kt")
|
||||||
|
public void testParameterReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/parameterReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("simpleReassignment.kt")
|
||||||
|
public void testSimpleReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/simpleReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("topLevelPropertyReassignment.kt")
|
||||||
|
public void testTopLevelPropertyReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/topLevelPropertyReassignment.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+138
@@ -0,0 +1,138 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.analysis.api.fir.test.cases.generated.cases.components.dataFlowInfoProvider;
|
||||||
|
|
||||||
|
import com.intellij.testFramework.TestDataPath;
|
||||||
|
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.kotlin.analysis.api.fir.test.configurators.AnalysisApiFirTestConfiguratorFactory;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode;
|
||||||
|
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.dataFlowInfoProvider.AbstractExitPointSnapshotTest;
|
||||||
|
import org.jetbrains.kotlin.test.TestMetadata;
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.analysis.api.GenerateAnalysisApiTestsKt}. DO NOT MODIFY MANUALLY */
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class FirIdeNormalAnalysisScriptSourceModuleExitPointSnapshotTestGenerated extends AbstractExitPointSnapshotTest {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public AnalysisApiTestConfigurator getConfigurator() {
|
||||||
|
return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator(
|
||||||
|
new AnalysisApiTestConfiguratorFactoryData(
|
||||||
|
FrontendKind.Fir,
|
||||||
|
TestModuleKind.ScriptSource,
|
||||||
|
AnalysisSessionMode.Normal,
|
||||||
|
AnalysisApiMode.Ide
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInExitPointSnapshot() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ControlFlow {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInControlFlow() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ConditionalJumps {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInConditionalJumps() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class DefiniteJumps {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDefiniteJumps() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class DifferentTargets {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDifferentTargets() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ExitPointEquivalence {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInExitPointEquivalence() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class UnconditionalJumps {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInUnconditionalJumps() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class DefaultValues {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDefaultValues() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class LanguageConstructs {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInLanguageConstructs() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Variables {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInVariables() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+594
@@ -0,0 +1,594 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.analysis.api.fir.test.cases.generated.cases.components.dataFlowInfoProvider;
|
||||||
|
|
||||||
|
import com.intellij.testFramework.TestDataPath;
|
||||||
|
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.kotlin.analysis.api.fir.test.configurators.AnalysisApiFirTestConfiguratorFactory;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode;
|
||||||
|
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.dataFlowInfoProvider.AbstractExitPointSnapshotTest;
|
||||||
|
import org.jetbrains.kotlin.test.TestMetadata;
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.analysis.api.GenerateAnalysisApiTestsKt}. DO NOT MODIFY MANUALLY */
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class FirIdeNormalAnalysisSourceModuleExitPointSnapshotTestGenerated extends AbstractExitPointSnapshotTest {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public AnalysisApiTestConfigurator getConfigurator() {
|
||||||
|
return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator(
|
||||||
|
new AnalysisApiTestConfiguratorFactoryData(
|
||||||
|
FrontendKind.Fir,
|
||||||
|
TestModuleKind.Source,
|
||||||
|
AnalysisSessionMode.Normal,
|
||||||
|
AnalysisApiMode.Ide
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInExitPointSnapshot() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ControlFlow {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInControlFlow() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("breakContinue.kt")
|
||||||
|
public void testBreakContinue() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/breakContinue.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("breakReturn.kt")
|
||||||
|
public void testBreakReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/breakReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("breakReturn2.kt")
|
||||||
|
public void testBreakReturn2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/breakReturn2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("continueReturn.kt")
|
||||||
|
public void testContinueReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/continueReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("continueReturn2.kt")
|
||||||
|
public void testContinueReturn2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/continueReturn2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultTryCatch.kt")
|
||||||
|
public void testDefaultTryCatch() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/defaultTryCatch.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultTryCatch2.kt")
|
||||||
|
public void testDefaultTryCatch2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/defaultTryCatch2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ConditionalJumps {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInConditionalJumps() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break.kt")
|
||||||
|
public void testBreak() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/break.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break2.kt")
|
||||||
|
public void testBreak2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/break2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break3.kt")
|
||||||
|
public void testBreak3() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/break3.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break4.kt")
|
||||||
|
public void testBreak4() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/break4.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break5.kt")
|
||||||
|
public void testBreak5() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/break5.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return.kt")
|
||||||
|
public void testReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/return.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return2.kt")
|
||||||
|
public void testReturn2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/return2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return3.kt")
|
||||||
|
public void testReturn3() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/return3.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class DefiniteJumps {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDefiniteJumps() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return.kt")
|
||||||
|
public void testReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps/return.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return2.kt")
|
||||||
|
public void testReturn2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps/return2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return3.kt")
|
||||||
|
public void testReturn3() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps/return3.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return4.kt")
|
||||||
|
public void testReturn4() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps/return4.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class DifferentTargets {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDifferentTargets() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break.kt")
|
||||||
|
public void testBreak() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets/break.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return.kt")
|
||||||
|
public void testReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets/return.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ExitPointEquivalence {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInExitPointEquivalence() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("breakAndReturn.kt")
|
||||||
|
public void testBreakAndReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/breakAndReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("breakContinueAndDefault.kt")
|
||||||
|
public void testBreakContinueAndDefault() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/breakContinueAndDefault.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("continueAndReturn.kt")
|
||||||
|
public void testContinueAndReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/continueAndReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultAndBreak.kt")
|
||||||
|
public void testDefaultAndBreak() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/defaultAndBreak.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultAndContinue.kt")
|
||||||
|
public void testDefaultAndContinue() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/defaultAndContinue.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultAndReturn.kt")
|
||||||
|
public void testDefaultAndReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/defaultAndReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultAndReturnInWhen.kt")
|
||||||
|
public void testDefaultAndReturnInWhen() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/defaultAndReturnInWhen.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultAndReturnInWhen2.kt")
|
||||||
|
public void testDefaultAndReturnInWhen2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/defaultAndReturnInWhen2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("multipleBreaks.kt")
|
||||||
|
public void testMultipleBreaks() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/multipleBreaks.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class UnconditionalJumps {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInUnconditionalJumps() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break.kt")
|
||||||
|
public void testBreak() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps/break.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break2.kt")
|
||||||
|
public void testBreak2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps/break2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break3.kt")
|
||||||
|
public void testBreak3() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps/break3.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break4.kt")
|
||||||
|
public void testBreak4() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps/break4.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class DefaultValues {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDefaultValues() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("anonymousFunction.kt")
|
||||||
|
public void testAnonymousFunction() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/anonymousFunction.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("anonymousObject.kt")
|
||||||
|
public void testAnonymousObject() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/anonymousObject.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("assignmentTarget.kt")
|
||||||
|
public void testAssignmentTarget() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/assignmentTarget.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("assignmentValue.kt")
|
||||||
|
public void testAssignmentValue() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/assignmentValue.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("calleeExpression.kt")
|
||||||
|
public void testCalleeExpression() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/calleeExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("errorDefaultType.kt")
|
||||||
|
public void testErrorDefaultType() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/errorDefaultType.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("expressionBlock.kt")
|
||||||
|
public void testExpressionBlock() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/expressionBlock.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("flexibleDefaultType.kt")
|
||||||
|
public void testFlexibleDefaultType() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/flexibleDefaultType.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("functionBodyBlock.kt")
|
||||||
|
public void testFunctionBodyBlock() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/functionBodyBlock.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("functionCall.kt")
|
||||||
|
public void testFunctionCall() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/functionCall.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("infixOperator.kt")
|
||||||
|
public void testInfixOperator() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/infixOperator.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("lambdaExpression.kt")
|
||||||
|
public void testLambdaExpression() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/lambdaExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("nullableDefaultType.kt")
|
||||||
|
public void testNullableDefaultType() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/nullableDefaultType.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("packageQualifier.kt")
|
||||||
|
public void testPackageQualifier() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/packageQualifier.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("singleTypedExpression.kt")
|
||||||
|
public void testSingleTypedExpression() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/singleTypedExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("suspendFunctionCall.kt")
|
||||||
|
public void testSuspendFunctionCall() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/suspendFunctionCall.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("typeQualifier.kt")
|
||||||
|
public void testTypeQualifier() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/typeQualifier.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("variableDeclaration.kt")
|
||||||
|
public void testVariableDeclaration() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/variableDeclaration.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("while.kt")
|
||||||
|
public void testWhile() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/while.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class LanguageConstructs {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInLanguageConstructs() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("arrayLiteral.kt")
|
||||||
|
public void testArrayLiteral() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/arrayLiteral.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("labeledReturn.kt")
|
||||||
|
public void testLabeledReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/labeledReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("nonLocalReturn.kt")
|
||||||
|
public void testNonLocalReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/nonLocalReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("nonLocalReturn2.kt")
|
||||||
|
public void testNonLocalReturn2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/nonLocalReturn2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("parameter.kt")
|
||||||
|
public void testParameter() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/parameter.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("parameterDefaultValue.kt")
|
||||||
|
public void testParameterDefaultValue() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/parameterDefaultValue.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return.kt")
|
||||||
|
public void testReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/return.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("trailingSemicolon.kt")
|
||||||
|
public void testTrailingSemicolon() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/trailingSemicolon.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Variables {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInVariables() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("arrayElementAugmentedReassignment.kt")
|
||||||
|
public void testArrayElementAugmentedReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/arrayElementAugmentedReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("arrayElementIncrementPostfix.kt")
|
||||||
|
public void testArrayElementIncrementPostfix() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/arrayElementIncrementPostfix.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("arrayElementIncrementPrefix.kt")
|
||||||
|
public void testArrayElementIncrementPrefix() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/arrayElementIncrementPrefix.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("augmentedReassignment.kt")
|
||||||
|
public void testAugmentedReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/augmentedReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("classPropertyReassignment.kt")
|
||||||
|
public void testClassPropertyReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/classPropertyReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("conditionalReassignment.kt")
|
||||||
|
public void testConditionalReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/conditionalReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("destructuredReassignment.kt")
|
||||||
|
public void testDestructuredReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/destructuredReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("errorTargetReassignment.kt")
|
||||||
|
public void testErrorTargetReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/errorTargetReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("incrementPostfix.kt")
|
||||||
|
public void testIncrementPostfix() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/incrementPostfix.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("incrementPrefix.kt")
|
||||||
|
public void testIncrementPrefix() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/incrementPrefix.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("lambdaParameterReassignment.kt")
|
||||||
|
public void testLambdaParameterReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/lambdaParameterReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("localVariable.kt")
|
||||||
|
public void testLocalVariable() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/localVariable.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("parameterReassignment.kt")
|
||||||
|
public void testParameterReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/parameterReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("simpleReassignment.kt")
|
||||||
|
public void testSimpleReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/simpleReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("topLevelPropertyReassignment.kt")
|
||||||
|
public void testTopLevelPropertyReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/topLevelPropertyReassignment.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.dataFlowInfoProvider
|
||||||
|
|
||||||
|
import com.intellij.openapi.util.TextRange
|
||||||
|
import com.intellij.psi.PsiElement
|
||||||
|
import com.intellij.psi.util.PsiTreeUtil
|
||||||
|
import org.jetbrains.kotlin.analysis.api.KtAnalysisNonPublicApi
|
||||||
|
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.stringRepresentation
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.base.AbstractAnalysisApiBasedTest
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.services.expressionMarkerProvider
|
||||||
|
import org.jetbrains.kotlin.psi.KtExpression
|
||||||
|
import org.jetbrains.kotlin.psi.KtFile
|
||||||
|
import org.jetbrains.kotlin.psi.psiUtil.startOffset
|
||||||
|
import org.jetbrains.kotlin.test.model.TestModule
|
||||||
|
import org.jetbrains.kotlin.test.services.TestServices
|
||||||
|
import org.jetbrains.kotlin.test.services.assertions
|
||||||
|
|
||||||
|
abstract class AbstractExitPointSnapshotTest : AbstractAnalysisApiBasedTest() {
|
||||||
|
override fun doTestByMainFile(mainFile: KtFile, mainModule: TestModule, testServices: TestServices) {
|
||||||
|
val textRange = testServices.expressionMarkerProvider.getSelectedRange(mainFile)
|
||||||
|
val statements = findStatements(mainFile, textRange)
|
||||||
|
|
||||||
|
@OptIn(KtAnalysisNonPublicApi::class)
|
||||||
|
val actualText = analyseForTest(mainFile) {
|
||||||
|
val snapshot = getExitPointSnapshot(statements)
|
||||||
|
stringRepresentation(snapshot)
|
||||||
|
}
|
||||||
|
|
||||||
|
testServices.assertions.assertEqualsToTestDataFileSibling(actualText)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun findStatements(mainFile: KtFile, textRange: TextRange): List<KtExpression> {
|
||||||
|
var candidate = PsiTreeUtil.findElementOfClassAtOffset(mainFile, textRange.startOffset, KtExpression::class.java, true)
|
||||||
|
?: error("Cannot find a starting element in range $textRange")
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
val parent = candidate.parent
|
||||||
|
if (parent is KtExpression && parent.textRange in textRange && parent.startOffset == candidate.startOffset) {
|
||||||
|
candidate = parent
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return generateSequence<PsiElement>(candidate) { it.nextSibling }
|
||||||
|
.filterIsInstance<KtExpression>()
|
||||||
|
.filter { it.textRange in textRange }
|
||||||
|
.toList()
|
||||||
|
}
|
||||||
|
}
|
||||||
+594
@@ -0,0 +1,594 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.analysis.api.standalone.fir.test.cases.generated.cases.components.dataFlowInfoProvider;
|
||||||
|
|
||||||
|
import com.intellij.testFramework.TestDataPath;
|
||||||
|
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.kotlin.analysis.api.standalone.fir.test.configurators.AnalysisApiFirStandaloneModeTestConfiguratorFactory;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode;
|
||||||
|
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode;
|
||||||
|
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.dataFlowInfoProvider.AbstractExitPointSnapshotTest;
|
||||||
|
import org.jetbrains.kotlin.test.TestMetadata;
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.analysis.api.GenerateAnalysisApiTestsKt}. DO NOT MODIFY MANUALLY */
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class FirStandaloneNormalAnalysisSourceModuleExitPointSnapshotTestGenerated extends AbstractExitPointSnapshotTest {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public AnalysisApiTestConfigurator getConfigurator() {
|
||||||
|
return AnalysisApiFirStandaloneModeTestConfiguratorFactory.INSTANCE.createConfigurator(
|
||||||
|
new AnalysisApiTestConfiguratorFactoryData(
|
||||||
|
FrontendKind.Fir,
|
||||||
|
TestModuleKind.Source,
|
||||||
|
AnalysisSessionMode.Normal,
|
||||||
|
AnalysisApiMode.Standalone
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInExitPointSnapshot() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ControlFlow {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInControlFlow() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("breakContinue.kt")
|
||||||
|
public void testBreakContinue() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/breakContinue.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("breakReturn.kt")
|
||||||
|
public void testBreakReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/breakReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("breakReturn2.kt")
|
||||||
|
public void testBreakReturn2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/breakReturn2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("continueReturn.kt")
|
||||||
|
public void testContinueReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/continueReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("continueReturn2.kt")
|
||||||
|
public void testContinueReturn2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/continueReturn2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultTryCatch.kt")
|
||||||
|
public void testDefaultTryCatch() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/defaultTryCatch.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultTryCatch2.kt")
|
||||||
|
public void testDefaultTryCatch2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/defaultTryCatch2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ConditionalJumps {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInConditionalJumps() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break.kt")
|
||||||
|
public void testBreak() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/break.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break2.kt")
|
||||||
|
public void testBreak2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/break2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break3.kt")
|
||||||
|
public void testBreak3() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/break3.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break4.kt")
|
||||||
|
public void testBreak4() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/break4.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break5.kt")
|
||||||
|
public void testBreak5() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/break5.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return.kt")
|
||||||
|
public void testReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/return.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return2.kt")
|
||||||
|
public void testReturn2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/return2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return3.kt")
|
||||||
|
public void testReturn3() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/conditionalJumps/return3.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class DefiniteJumps {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDefiniteJumps() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return.kt")
|
||||||
|
public void testReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps/return.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return2.kt")
|
||||||
|
public void testReturn2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps/return2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return3.kt")
|
||||||
|
public void testReturn3() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps/return3.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return4.kt")
|
||||||
|
public void testReturn4() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/definiteJumps/return4.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class DifferentTargets {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDifferentTargets() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break.kt")
|
||||||
|
public void testBreak() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets/break.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return.kt")
|
||||||
|
public void testReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/differentTargets/return.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ExitPointEquivalence {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInExitPointEquivalence() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("breakAndReturn.kt")
|
||||||
|
public void testBreakAndReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/breakAndReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("breakContinueAndDefault.kt")
|
||||||
|
public void testBreakContinueAndDefault() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/breakContinueAndDefault.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("continueAndReturn.kt")
|
||||||
|
public void testContinueAndReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/continueAndReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultAndBreak.kt")
|
||||||
|
public void testDefaultAndBreak() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/defaultAndBreak.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultAndContinue.kt")
|
||||||
|
public void testDefaultAndContinue() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/defaultAndContinue.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultAndReturn.kt")
|
||||||
|
public void testDefaultAndReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/defaultAndReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultAndReturnInWhen.kt")
|
||||||
|
public void testDefaultAndReturnInWhen() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/defaultAndReturnInWhen.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("defaultAndReturnInWhen2.kt")
|
||||||
|
public void testDefaultAndReturnInWhen2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/defaultAndReturnInWhen2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("multipleBreaks.kt")
|
||||||
|
public void testMultipleBreaks() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/exitPointEquivalence/multipleBreaks.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class UnconditionalJumps {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInUnconditionalJumps() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break.kt")
|
||||||
|
public void testBreak() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps/break.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break2.kt")
|
||||||
|
public void testBreak2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps/break2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break3.kt")
|
||||||
|
public void testBreak3() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps/break3.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("break4.kt")
|
||||||
|
public void testBreak4() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/unconditionalJumps/break4.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class DefaultValues {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDefaultValues() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("anonymousFunction.kt")
|
||||||
|
public void testAnonymousFunction() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/anonymousFunction.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("anonymousObject.kt")
|
||||||
|
public void testAnonymousObject() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/anonymousObject.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("assignmentTarget.kt")
|
||||||
|
public void testAssignmentTarget() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/assignmentTarget.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("assignmentValue.kt")
|
||||||
|
public void testAssignmentValue() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/assignmentValue.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("calleeExpression.kt")
|
||||||
|
public void testCalleeExpression() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/calleeExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("errorDefaultType.kt")
|
||||||
|
public void testErrorDefaultType() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/errorDefaultType.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("expressionBlock.kt")
|
||||||
|
public void testExpressionBlock() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/expressionBlock.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("flexibleDefaultType.kt")
|
||||||
|
public void testFlexibleDefaultType() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/flexibleDefaultType.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("functionBodyBlock.kt")
|
||||||
|
public void testFunctionBodyBlock() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/functionBodyBlock.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("functionCall.kt")
|
||||||
|
public void testFunctionCall() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/functionCall.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("infixOperator.kt")
|
||||||
|
public void testInfixOperator() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/infixOperator.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("lambdaExpression.kt")
|
||||||
|
public void testLambdaExpression() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/lambdaExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("nullableDefaultType.kt")
|
||||||
|
public void testNullableDefaultType() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/nullableDefaultType.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("packageQualifier.kt")
|
||||||
|
public void testPackageQualifier() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/packageQualifier.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("singleTypedExpression.kt")
|
||||||
|
public void testSingleTypedExpression() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/singleTypedExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("suspendFunctionCall.kt")
|
||||||
|
public void testSuspendFunctionCall() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/suspendFunctionCall.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("typeQualifier.kt")
|
||||||
|
public void testTypeQualifier() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/typeQualifier.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("variableDeclaration.kt")
|
||||||
|
public void testVariableDeclaration() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/variableDeclaration.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("while.kt")
|
||||||
|
public void testWhile() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/defaultValues/while.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class LanguageConstructs {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInLanguageConstructs() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("arrayLiteral.kt")
|
||||||
|
public void testArrayLiteral() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/arrayLiteral.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("labeledReturn.kt")
|
||||||
|
public void testLabeledReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/labeledReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("nonLocalReturn.kt")
|
||||||
|
public void testNonLocalReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/nonLocalReturn.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("nonLocalReturn2.kt")
|
||||||
|
public void testNonLocalReturn2() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/nonLocalReturn2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("parameter.kt")
|
||||||
|
public void testParameter() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/parameter.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("parameterDefaultValue.kt")
|
||||||
|
public void testParameterDefaultValue() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/parameterDefaultValue.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("return.kt")
|
||||||
|
public void testReturn() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/return.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("trailingSemicolon.kt")
|
||||||
|
public void testTrailingSemicolon() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/languageConstructs/trailingSemicolon.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Variables {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInVariables() {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("arrayElementAugmentedReassignment.kt")
|
||||||
|
public void testArrayElementAugmentedReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/arrayElementAugmentedReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("arrayElementIncrementPostfix.kt")
|
||||||
|
public void testArrayElementIncrementPostfix() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/arrayElementIncrementPostfix.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("arrayElementIncrementPrefix.kt")
|
||||||
|
public void testArrayElementIncrementPrefix() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/arrayElementIncrementPrefix.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("augmentedReassignment.kt")
|
||||||
|
public void testAugmentedReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/augmentedReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("classPropertyReassignment.kt")
|
||||||
|
public void testClassPropertyReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/classPropertyReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("conditionalReassignment.kt")
|
||||||
|
public void testConditionalReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/conditionalReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("destructuredReassignment.kt")
|
||||||
|
public void testDestructuredReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/destructuredReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("errorTargetReassignment.kt")
|
||||||
|
public void testErrorTargetReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/errorTargetReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("incrementPostfix.kt")
|
||||||
|
public void testIncrementPostfix() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/incrementPostfix.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("incrementPrefix.kt")
|
||||||
|
public void testIncrementPrefix() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/incrementPrefix.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("lambdaParameterReassignment.kt")
|
||||||
|
public void testLambdaParameterReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/lambdaParameterReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("localVariable.kt")
|
||||||
|
public void testLocalVariable() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/localVariable.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("parameterReassignment.kt")
|
||||||
|
public void testParameterReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/parameterReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("simpleReassignment.kt")
|
||||||
|
public void testSimpleReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/simpleReassignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("topLevelPropertyReassignment.kt")
|
||||||
|
public void testTopLevelPropertyReassignment() {
|
||||||
|
runTest("analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/variables/topLevelPropertyReassignment.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -92,7 +92,8 @@ public abstract class KtAnalysisSession(final override val token: KtLifetimeToke
|
|||||||
KtResolveExtensionInfoProviderMixIn,
|
KtResolveExtensionInfoProviderMixIn,
|
||||||
KtCompilerFacilityMixIn,
|
KtCompilerFacilityMixIn,
|
||||||
KtMetadataCalculatorMixIn,
|
KtMetadataCalculatorMixIn,
|
||||||
KtSubstitutorProviderMixIn {
|
KtSubstitutorProviderMixIn,
|
||||||
|
KtDataFlowInfoProviderMixin {
|
||||||
|
|
||||||
public abstract val useSiteModule: KtModule
|
public abstract val useSiteModule: KtModule
|
||||||
|
|
||||||
@@ -213,6 +214,11 @@ public abstract class KtAnalysisSession(final override val token: KtLifetimeToke
|
|||||||
|
|
||||||
internal val substitutorProvider: KtSubstitutorProvider get() = substitutorProviderImpl
|
internal val substitutorProvider: KtSubstitutorProvider get() = substitutorProviderImpl
|
||||||
protected abstract val substitutorProviderImpl: KtSubstitutorProvider
|
protected abstract val substitutorProviderImpl: KtSubstitutorProvider
|
||||||
|
|
||||||
|
@KtAnalysisNonPublicApi
|
||||||
|
internal val dataFlowInfoProvider: KtDataFlowInfoProvider get() = dataFlowInfoProviderImpl
|
||||||
|
@KtAnalysisNonPublicApi
|
||||||
|
protected abstract val dataFlowInfoProviderImpl: KtDataFlowInfoProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun KtAnalysisSession.getModule(element: PsiElement): KtModule {
|
public fun KtAnalysisSession.getModule(element: PsiElement): KtModule {
|
||||||
|
|||||||
+103
@@ -0,0 +1,103 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.analysis.api.components
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.analysis.api.KtAnalysisNonPublicApi
|
||||||
|
import org.jetbrains.kotlin.analysis.api.lifetime.withValidityAssertion
|
||||||
|
import org.jetbrains.kotlin.analysis.api.symbols.KtVariableLikeSymbol
|
||||||
|
import org.jetbrains.kotlin.analysis.api.types.KtType
|
||||||
|
import org.jetbrains.kotlin.psi.KtExpression
|
||||||
|
import org.jetbrains.kotlin.psi.KtReturnExpression
|
||||||
|
|
||||||
|
@KtAnalysisNonPublicApi
|
||||||
|
public abstract class KtDataFlowInfoProvider : KtAnalysisSessionComponent() {
|
||||||
|
public abstract fun getExitPointSnapshot(statements: List<KtExpression>): KtDataFlowExitPointSnapshot
|
||||||
|
}
|
||||||
|
|
||||||
|
@KtAnalysisNonPublicApi
|
||||||
|
public interface KtDataFlowInfoProviderMixin : KtAnalysisSessionMixIn {
|
||||||
|
public fun getExitPointSnapshot(statements: List<KtExpression>): KtDataFlowExitPointSnapshot = withValidityAssertion {
|
||||||
|
return analysisSession.dataFlowInfoProvider.getExitPointSnapshot(statements)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@KtAnalysisNonPublicApi
|
||||||
|
public class KtDataFlowExitPointSnapshot(
|
||||||
|
/**
|
||||||
|
* A default expression, if any.
|
||||||
|
* @see [DefaultExpressionInfo] for more information.
|
||||||
|
*/
|
||||||
|
public val defaultExpressionInfo: DefaultExpressionInfo?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A list of [KtReturnExpression]s that return a value.
|
||||||
|
*/
|
||||||
|
public val valuedReturnExpressions: List<KtReturnExpression>,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A common supertype of values returned in [valuedReturnExpressions].
|
||||||
|
*/
|
||||||
|
public val returnValueType: KtType?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* `break` and `continue` jump expressions.
|
||||||
|
* @see [hasJumps] for the definition of jumps.
|
||||||
|
*/
|
||||||
|
public val loopJumpExpressions: List<KtExpression>,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* `true` if there are any control-flow statements that jump outside given statements.
|
||||||
|
* Jumps include both loop jumps (`break` and `continue`) and `return`s.
|
||||||
|
* Conditional blocks (`if`) and `throw`s are not considered as jumps.
|
||||||
|
*/
|
||||||
|
public val hasJumps: Boolean,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* `true` if next-executed instructions for the potential default expression and jump expressions are different.
|
||||||
|
*/
|
||||||
|
public val hasEscapingJumps: Boolean,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* `true` if there are jumps of different kinds (e.g., there is both a `break` and a `return`).
|
||||||
|
*/
|
||||||
|
public val hasMultipleJumpKinds: Boolean,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* `true` if two or more jumps have different next-executed instructions. Such as, there are both inner and outer loop `break`s.
|
||||||
|
*/
|
||||||
|
public val hasMultipleJumpTargets: Boolean,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* local variable reassignments found in given statements.
|
||||||
|
*/
|
||||||
|
public val variableReassignments: List<VariableReassignment>
|
||||||
|
) {
|
||||||
|
/**
|
||||||
|
* Represents a default expression (generally, a last given statement if it has a meaningful result type).
|
||||||
|
* Expressions that always return [Nothing], such as `return`, `break`, `continue` or `throw`, cannot be default expressions.
|
||||||
|
*/
|
||||||
|
public class DefaultExpressionInfo(
|
||||||
|
/** The default expression. */
|
||||||
|
public val expression: KtExpression,
|
||||||
|
|
||||||
|
/** The default expression type. */
|
||||||
|
public val type: KtType
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a local variable reassignment.
|
||||||
|
*/
|
||||||
|
public class VariableReassignment(
|
||||||
|
/** The reassignment expression. */
|
||||||
|
public val expression: KtExpression,
|
||||||
|
|
||||||
|
/** Reassigned variable symbol. */
|
||||||
|
public val variable: KtVariableLikeSymbol,
|
||||||
|
|
||||||
|
/** `true` if the variable is both read and set (as in `x += y` or `x++`). */
|
||||||
|
public val isAugmented: Boolean
|
||||||
|
)
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
fun test() {
|
||||||
|
while (cond()) {
|
||||||
|
<expr>if (foo() == 5) {
|
||||||
|
break
|
||||||
|
} else if (foo() == 6) {
|
||||||
|
continue
|
||||||
|
}</expr>
|
||||||
|
consume("foo")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun cond(): Boolean = true
|
||||||
|
|
||||||
|
fun foo(): Int = 0
|
||||||
|
|
||||||
|
fun consume(text: String?) = {}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = if (foo() == 5) {
|
||||||
|
break
|
||||||
|
} else if (foo() == 6) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = true
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break,
|
||||||
|
continue
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
fun test() {
|
||||||
|
while (cond()) {
|
||||||
|
<expr>if (foo() == 5) {
|
||||||
|
break
|
||||||
|
} else if (foo() == 6) {
|
||||||
|
return
|
||||||
|
}</expr>
|
||||||
|
consume("foo")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun cond(): Boolean = true
|
||||||
|
|
||||||
|
fun foo(): Int = 0
|
||||||
|
|
||||||
|
fun consume(text: String?) = {}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = if (foo() == 5) {
|
||||||
|
break
|
||||||
|
} else if (foo() == 6) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = true
|
||||||
|
hasMultipleJumpTargets = true
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
fun test(): Int {
|
||||||
|
while (cond()) {
|
||||||
|
<expr>if (foo() == 5) {
|
||||||
|
return 1
|
||||||
|
} else if (foo() == 6) {
|
||||||
|
break
|
||||||
|
}</expr>
|
||||||
|
consume("foo")
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
fun cond(): Boolean = true
|
||||||
|
|
||||||
|
fun foo(): Int = 0
|
||||||
|
|
||||||
|
fun consume(text: String?) = {}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = if (foo() == 5) {
|
||||||
|
return 1
|
||||||
|
} else if (foo() == 6) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = true
|
||||||
|
hasMultipleJumpTargets = true
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break
|
||||||
|
]
|
||||||
|
returnValueType = kotlin.Int
|
||||||
|
valuedReturnExpressions = [
|
||||||
|
return 1
|
||||||
|
]
|
||||||
|
variableReassignments = []
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
fun test(a: Int): Int {
|
||||||
|
val b: Int = a + 10
|
||||||
|
for (n in 1..b) {
|
||||||
|
<expr>if (n > 5) throw Exception("")
|
||||||
|
if (a + n > b) break
|
||||||
|
println(b - n)</expr>
|
||||||
|
}
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = println(b - n)
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
fun foo(a: Int): Int {
|
||||||
|
val b: Int = 1
|
||||||
|
for (n in 1..a) {
|
||||||
|
<expr>if (a + b > 0) break
|
||||||
|
consume(a - b)
|
||||||
|
if (a - b > 0) break
|
||||||
|
consume(a + b)</expr>
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = consume(a + b)
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break,
|
||||||
|
break
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
fun foo(a: Int): Int {
|
||||||
|
val b: Int = 1
|
||||||
|
for (n in 1..a) {
|
||||||
|
<expr>if (a + b > 0) break
|
||||||
|
val c: Int
|
||||||
|
consume(a - b)
|
||||||
|
if (a - b > 0) break
|
||||||
|
consume(a + b)</expr>
|
||||||
|
c = 1
|
||||||
|
consume(c)
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = consume(a + b)
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break,
|
||||||
|
break
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
fun foo(a: Int): Int {
|
||||||
|
val b: Int = 1
|
||||||
|
for (n in 1..a) {
|
||||||
|
<expr>if (a + b > 0) break
|
||||||
|
else {
|
||||||
|
consume(a - b)
|
||||||
|
if (a - b > 0) break else consume(a + b)
|
||||||
|
}
|
||||||
|
</expr>
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = if (a + b > 0) break
|
||||||
|
else {
|
||||||
|
consume(a - b)
|
||||||
|
if (a - b > 0) break else consume(a + b)
|
||||||
|
}
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break,
|
||||||
|
break
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
fun foo(a: Int): Int {
|
||||||
|
val b: Int = 1
|
||||||
|
for (n in 1..a) {
|
||||||
|
<expr>when {
|
||||||
|
a + b > 0 -> break
|
||||||
|
a - b > 0 -> break
|
||||||
|
else -> consume(0)
|
||||||
|
}</expr>
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = when {
|
||||||
|
a + b > 0 -> break
|
||||||
|
a - b > 0 -> break
|
||||||
|
else -> consume(0)
|
||||||
|
}
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break,
|
||||||
|
break
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fun foo(a: Int): Int {
|
||||||
|
val b: Int = 1
|
||||||
|
<expr>if (a + b > 0) return 0
|
||||||
|
consume(a - b)</expr>
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = consume(a - b)
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = kotlin.Int
|
||||||
|
valuedReturnExpressions = [
|
||||||
|
return 0
|
||||||
|
]
|
||||||
|
variableReassignments = []
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
fun foo(a: Int): Int {
|
||||||
|
val b: Int = 1
|
||||||
|
<expr>when (a + b) {
|
||||||
|
0 -> return 0
|
||||||
|
1 -> consume(1)
|
||||||
|
else -> consume(2)
|
||||||
|
}
|
||||||
|
</expr>
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = when (a + b) {
|
||||||
|
0 -> return 0
|
||||||
|
1 -> consume(1)
|
||||||
|
else -> consume(2)
|
||||||
|
}
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = kotlin.Int
|
||||||
|
valuedReturnExpressions = [
|
||||||
|
return 0
|
||||||
|
]
|
||||||
|
variableReassignments = []
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
fun foo(a: Int): Int {
|
||||||
|
val b: Int = 1
|
||||||
|
<expr>if (a + b > 0) return 0
|
||||||
|
else if (a - b < 0) consume(a - b)
|
||||||
|
else consume(0)</expr>
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = if (a + b > 0) return 0
|
||||||
|
else if (a - b < 0) consume(a - b)
|
||||||
|
else consume(0)
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = kotlin.Int
|
||||||
|
valuedReturnExpressions = [
|
||||||
|
return 0
|
||||||
|
]
|
||||||
|
variableReassignments = []
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
fun test() {
|
||||||
|
while (cond()) {
|
||||||
|
<expr>if (foo() == 5) {
|
||||||
|
continue
|
||||||
|
} else if (foo() == 6) {
|
||||||
|
return
|
||||||
|
}</expr>
|
||||||
|
consume("foo")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun cond(): Boolean = true
|
||||||
|
|
||||||
|
fun foo(): Int = 0
|
||||||
|
|
||||||
|
fun consume(text: String?) = {}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = if (foo() == 5) {
|
||||||
|
continue
|
||||||
|
} else if (foo() == 6) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = true
|
||||||
|
hasMultipleJumpTargets = true
|
||||||
|
loopJumpExpressions = [
|
||||||
|
continue
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
fun test(): Int {
|
||||||
|
while (cond()) {
|
||||||
|
<expr>if (foo() == 5) {
|
||||||
|
return 1
|
||||||
|
} else if (foo() == 6) {
|
||||||
|
continue
|
||||||
|
}</expr>
|
||||||
|
consume("foo")
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
fun cond(): Boolean = true
|
||||||
|
|
||||||
|
fun foo(): Int = 0
|
||||||
|
|
||||||
|
fun consume(text: String?) = {}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = if (foo() == 5) {
|
||||||
|
return 1
|
||||||
|
} else if (foo() == 6) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = true
|
||||||
|
hasMultipleJumpTargets = true
|
||||||
|
loopJumpExpressions = [
|
||||||
|
continue
|
||||||
|
]
|
||||||
|
returnValueType = kotlin.Int
|
||||||
|
valuedReturnExpressions = [
|
||||||
|
return 1
|
||||||
|
]
|
||||||
|
variableReassignments = []
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
consume(1)
|
||||||
|
<expr>try {
|
||||||
|
dangerous()
|
||||||
|
} catch (e: FooException) {
|
||||||
|
consume(e.message?.length ?: 0)
|
||||||
|
"error"
|
||||||
|
}</expr>
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(n: Int) {}
|
||||||
|
|
||||||
|
@Throws(FooException::class)
|
||||||
|
fun dangerous(): String {
|
||||||
|
return "foo"
|
||||||
|
}
|
||||||
|
|
||||||
|
class FooException : Exception()
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = try {
|
||||||
|
dangerous()
|
||||||
|
} catch (e: FooException) {
|
||||||
|
consume(e.message?.length ?: 0)
|
||||||
|
"error"
|
||||||
|
}
|
||||||
|
type = kotlin.String
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = false
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
consume(1)
|
||||||
|
<expr>try {
|
||||||
|
dangerous()
|
||||||
|
} catch (e: FooException) {
|
||||||
|
consume(e.message?.length ?: 0)
|
||||||
|
throw e
|
||||||
|
}</expr>
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(n: Int) {}
|
||||||
|
|
||||||
|
@Throws(FooException::class)
|
||||||
|
fun dangerous(): String {
|
||||||
|
return "foo"
|
||||||
|
}
|
||||||
|
|
||||||
|
class FooException : Exception()
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = try {
|
||||||
|
dangerous()
|
||||||
|
} catch (e: FooException) {
|
||||||
|
consume(e.message?.length ?: 0)
|
||||||
|
throw e
|
||||||
|
}
|
||||||
|
type = kotlin.String
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = false
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
fun foo(a: Int): Int {
|
||||||
|
val b: Int = 1
|
||||||
|
<expr>if (a + b > 0) return 1
|
||||||
|
else if (a - b < 0) return 2
|
||||||
|
else return b</expr>
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = null
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = kotlin.Int
|
||||||
|
valuedReturnExpressions = [
|
||||||
|
return 1,
|
||||||
|
return 2,
|
||||||
|
return b
|
||||||
|
]
|
||||||
|
variableReassignments = []
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fun foo(a: Int): Int {
|
||||||
|
val b: Int = 1
|
||||||
|
<expr>when (a + b) {
|
||||||
|
0 -> return b
|
||||||
|
1 -> return -b
|
||||||
|
else -> return a - b
|
||||||
|
}</expr>
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = null
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = kotlin.Int
|
||||||
|
valuedReturnExpressions = [
|
||||||
|
return b,
|
||||||
|
return -b,
|
||||||
|
return a - b
|
||||||
|
]
|
||||||
|
variableReassignments = []
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
fun foo(a: Int): Int {
|
||||||
|
a.let {
|
||||||
|
<expr>if (it > 0) return it else return@foo -it</expr>
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = null
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = kotlin.Int
|
||||||
|
valuedReturnExpressions = [
|
||||||
|
return it,
|
||||||
|
return@foo -it
|
||||||
|
]
|
||||||
|
variableReassignments = []
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
fun foo(a: Int): Int {
|
||||||
|
a.let {
|
||||||
|
<expr>if (it > 0) return@foo it else return -it</expr>
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = null
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = kotlin.Int
|
||||||
|
valuedReturnExpressions = [
|
||||||
|
return@foo it,
|
||||||
|
return -it
|
||||||
|
]
|
||||||
|
variableReassignments = []
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
fun test() {
|
||||||
|
outer@ while (cond()) {
|
||||||
|
consume(1)
|
||||||
|
while (cond()) {
|
||||||
|
consume(2)
|
||||||
|
<expr>if (cond()) {
|
||||||
|
break
|
||||||
|
} else if (cond()) {
|
||||||
|
break@outer
|
||||||
|
}</expr>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
|
|
||||||
|
fun cond(): Boolean = true
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = if (cond()) {
|
||||||
|
break
|
||||||
|
} else if (cond()) {
|
||||||
|
break@outer
|
||||||
|
}
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = true
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break,
|
||||||
|
break@outer
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
fun test(flag: Boolean): Int {
|
||||||
|
block {
|
||||||
|
<expr>if (flag) {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
consume("foo")
|
||||||
|
return@block</expr>
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun block(block: () -> Unit) {}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = null
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = true
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = kotlin.Int
|
||||||
|
valuedReturnExpressions = [
|
||||||
|
return 1
|
||||||
|
]
|
||||||
|
variableReassignments = []
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
fun foo(a: Int) {
|
||||||
|
val b: Int = 1
|
||||||
|
for (n in 1..b) {
|
||||||
|
<expr>if (a > 0) throw Exception("")
|
||||||
|
if (a + b > 0) break
|
||||||
|
consume(a - b)
|
||||||
|
return</expr>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = null
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = true
|
||||||
|
hasMultipleJumpTargets = true
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
fun foo(a: Int) {
|
||||||
|
val b: Int = 1
|
||||||
|
loop1@ for (p in 1..b) {
|
||||||
|
loop2@ for (n in 1..b) {
|
||||||
|
<expr>if (a > 0) throw Exception("")
|
||||||
|
if (a + b > 0) break@loop2
|
||||||
|
if (a - b > 0) continue@loop1</expr>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = if (a - b > 0) continue@loop1
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = true
|
||||||
|
hasMultipleJumpTargets = true
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break@loop2,
|
||||||
|
continue@loop1
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
fun foo(a: Int) {
|
||||||
|
val b: Int = 1
|
||||||
|
for (n in 1..b) {
|
||||||
|
<expr>if (a > 0) throw Exception("")
|
||||||
|
if (a + b > 0) continue
|
||||||
|
consume(a - b)
|
||||||
|
return</expr>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = null
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = true
|
||||||
|
hasMultipleJumpTargets = true
|
||||||
|
loopJumpExpressions = [
|
||||||
|
continue
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
fun foo(a: Int) {
|
||||||
|
val b: Int = 1
|
||||||
|
for (n in 1..b) {
|
||||||
|
<expr>if (a > 0) throw Exception("")
|
||||||
|
if (a + b > 0) break
|
||||||
|
consume(a - b)</expr>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = consume(a - b)
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
fun foo(a: Int) {
|
||||||
|
val b: Int = 1
|
||||||
|
for (n in 1..b) {
|
||||||
|
<expr>if (a > 0) throw Exception("")
|
||||||
|
if (a + b > 0) continue
|
||||||
|
consume(a - b)</expr>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = consume(a - b)
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = [
|
||||||
|
continue
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
fun foo(a: Int) {
|
||||||
|
val b: Int = 1
|
||||||
|
|
||||||
|
<expr>if (a > 0) throw Exception("")
|
||||||
|
if (b + a > 0) return
|
||||||
|
consume(a - b)</expr>
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = consume(a - b)
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
fun example(i: Int) {
|
||||||
|
when (i) {
|
||||||
|
1 -> {
|
||||||
|
<expr>if (i > 5) {
|
||||||
|
consume("true")
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
consume("false")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
consume("!!")</expr>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = consume("!!")
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
fun example(i: Int) {
|
||||||
|
when (i) {
|
||||||
|
1 -> {
|
||||||
|
<expr>if (i > 5) {
|
||||||
|
consume("true")
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
consume("false")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
consume("!!")</expr>
|
||||||
|
}
|
||||||
|
2 -> {
|
||||||
|
consume("another")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = consume("!!")
|
||||||
|
type = kotlin.Unit
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
fun foo(a: Int) {
|
||||||
|
val b: Int = 1
|
||||||
|
loop1@ for (p in 1..b) {
|
||||||
|
loop2@ for (n in 1..b) {
|
||||||
|
<expr>if (a > 0) throw Exception("")
|
||||||
|
if (a + b > 0) break@loop1
|
||||||
|
consume(a - b)
|
||||||
|
break@loop2</expr>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = null
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = true
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break@loop1,
|
||||||
|
break@loop2
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
fun test() {
|
||||||
|
x@ while (cond()) {
|
||||||
|
<expr>consume(5)
|
||||||
|
break@x</expr>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun cond(): Boolean = true
|
||||||
|
|
||||||
|
fun consume(n: Int) {}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = null
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break@x
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
fun foo(a: Int): Int {
|
||||||
|
val b: Int = 1
|
||||||
|
for (n in 1..a) {
|
||||||
|
<expr>if (a + b > 0) break
|
||||||
|
consume(a - b)
|
||||||
|
break</expr>
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = null
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break,
|
||||||
|
break
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
fun foo(a: Int): Int {
|
||||||
|
val b: Int = 1
|
||||||
|
for (n in 1..a) {
|
||||||
|
<expr>if (a + b > 0) break
|
||||||
|
else {
|
||||||
|
consume(a - b)
|
||||||
|
break
|
||||||
|
}</expr>
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = null
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break,
|
||||||
|
break
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
fun foo(a: Int): Int {
|
||||||
|
val b: Int = 1
|
||||||
|
for (n in 1..a) {
|
||||||
|
<expr>when {
|
||||||
|
a + b > 0 -> break
|
||||||
|
a - b > 0 -> break
|
||||||
|
else -> {
|
||||||
|
consume(0)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}</expr>
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(obj: Any?) {}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = null
|
||||||
|
hasEscapingJumps = true
|
||||||
|
hasJumps = true
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = [
|
||||||
|
break,
|
||||||
|
break,
|
||||||
|
break
|
||||||
|
]
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
fun test() {
|
||||||
|
<expr>fun(n: Int): Int {
|
||||||
|
return n + 1
|
||||||
|
}</expr>
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = fun(n: Int): Int {
|
||||||
|
return n + 1
|
||||||
|
}
|
||||||
|
type = kotlin.Function1<kotlin.Int, kotlin.Int>
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = false
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
fun test() {
|
||||||
|
<expr>object {
|
||||||
|
fun foo() {}
|
||||||
|
}</expr>
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = object {
|
||||||
|
fun foo() {}
|
||||||
|
}
|
||||||
|
type = <anonymous>
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = false
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
fun test() {
|
||||||
|
buildFoo {
|
||||||
|
<expr>value</expr> = produceString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun buildFoo(builder: Foo.() -> Unit): Foo {
|
||||||
|
val foo = Foo()
|
||||||
|
foo.builder()
|
||||||
|
return foo
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Foo {
|
||||||
|
var value: String? = null
|
||||||
|
}
|
||||||
|
|
||||||
|
fun produceString(): String = ""
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = null
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = false
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
fun test() {
|
||||||
|
buildFoo {
|
||||||
|
value = <expr>produceString()</expr>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun buildFoo(builder: Foo.() -> Unit): Foo {
|
||||||
|
val foo = Foo()
|
||||||
|
foo.builder()
|
||||||
|
return foo
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Foo {
|
||||||
|
var value: String? = null
|
||||||
|
}
|
||||||
|
|
||||||
|
fun produceString(): String = ""
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = produceString()
|
||||||
|
type = kotlin.String
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = false
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
fun test(foo: Foo) {
|
||||||
|
foo.<expr>bar()</expr>
|
||||||
|
}
|
||||||
|
|
||||||
|
class Foo {
|
||||||
|
fun bar(): String {}
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = bar()
|
||||||
|
type = kotlin.String
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = false
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
fun test() {
|
||||||
|
<expr>call()</expr>
|
||||||
|
}
|
||||||
|
|
||||||
|
fun call(): Foo? {
|
||||||
|
return null
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = call()
|
||||||
|
type = ERROR CLASS: Symbol not found for Foo?
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = false
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
fun test(flag: Boolean) {
|
||||||
|
if (flag) <expr>{
|
||||||
|
consume(1)
|
||||||
|
}</expr> else {
|
||||||
|
consume(2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consume(n: Int) {}
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = null
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = false
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
// FILE: JavaClass.java
|
||||||
|
class FooJava {
|
||||||
|
String call() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
fun text(foo: FooJava) {
|
||||||
|
<expr>foo.call()</expr>
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = foo.call()
|
||||||
|
type = kotlin.String!
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = false
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
fun test(n: Int) <expr>{
|
||||||
|
consume(1)
|
||||||
|
consume(n)
|
||||||
|
}</expr>
|
||||||
|
|
||||||
|
fun consume(n: Int) {}
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = null
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = false
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
fun test() {
|
||||||
|
<expr>call(1, "foo")</expr>
|
||||||
|
}
|
||||||
|
|
||||||
|
fun call(n: Int, text: String): Int = n
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
KtDataFlowExitPointSnapshot:
|
||||||
|
defaultExpressionInfo = DefaultExpressionInfo:
|
||||||
|
expression = call(1, "foo")
|
||||||
|
type = kotlin.Int
|
||||||
|
hasEscapingJumps = false
|
||||||
|
hasJumps = false
|
||||||
|
hasMultipleJumpKinds = false
|
||||||
|
hasMultipleJumpTargets = false
|
||||||
|
loopJumpExpressions = []
|
||||||
|
returnValueType = null
|
||||||
|
valuedReturnExpressions = []
|
||||||
|
variableReassignments = []
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user