diff --git a/idea/src/org/jetbrains/kotlin/idea/slicer/ArgumentSliceProducer.kt b/idea/src/org/jetbrains/kotlin/idea/slicer/ArgumentSliceProducer.kt index c53a800fbd67d..af8acd23f1156 100644 --- a/idea/src/org/jetbrains/kotlin/idea/slicer/ArgumentSliceProducer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/slicer/ArgumentSliceProducer.kt @@ -38,6 +38,8 @@ data class ArgumentSliceProducer private constructor( return listOf(KotlinSliceUsage(argumentExpression, parent, mode, forcedExpressionMode = true)) } + override val testPresentation = "ARGUMENT #$parameterIndex".let { if (isExtension) "$it EXTENSION" else it } + private fun extractArgumentExpression(refElement: PsiElement): PsiElement? { val refParent = refElement.parent return when { diff --git a/idea/src/org/jetbrains/kotlin/idea/slicer/CallSliceProducer.kt b/idea/src/org/jetbrains/kotlin/idea/slicer/CallSliceProducer.kt index f8e3625a660da..97f79db5eebaf 100644 --- a/idea/src/org/jetbrains/kotlin/idea/slicer/CallSliceProducer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/slicer/CallSliceProducer.kt @@ -49,6 +49,9 @@ object CallSliceProducer : SliceProducer { } } + override val testPresentation: String? + get() = null + override fun equals(other: Any?) = other === this override fun hashCode() = 0 diff --git a/idea/src/org/jetbrains/kotlin/idea/slicer/InflowSlicer.kt b/idea/src/org/jetbrains/kotlin/idea/slicer/InflowSlicer.kt index 918f37ca6551a..1c1a41942901c 100644 --- a/idea/src/org/jetbrains/kotlin/idea/slicer/InflowSlicer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/slicer/InflowSlicer.kt @@ -145,16 +145,16 @@ class InflowSlicer( lambda.passToProcessor(mode.dropBehaviour()) } - is LambdaArgumentInflowBehaviour -> { + is LambdaParameterInflowBehaviour -> { val valueParameters = lambda.valueParameters if (valueParameters.isEmpty() && lambda is KtFunctionLiteral) { - if (currentBehaviour.argumentIndex == 0) { + if (currentBehaviour.parameterIndex == 0) { lambda.implicitItUsages().forEach { it.passToProcessor(mode.dropBehaviour()) } } } else { - valueParameters.getOrNull(currentBehaviour.argumentIndex)?.passToProcessor(mode.dropBehaviour()) + valueParameters.getOrNull(currentBehaviour.parameterIndex)?.passToProcessor(mode.dropBehaviour()) } } @@ -238,9 +238,9 @@ class InflowSlicer( referencedDeclaration.passToProcessor(mode.dropBehaviour()) } - is LambdaArgumentInflowBehaviour -> { + is LambdaParameterInflowBehaviour -> { val parameter = (referencedDeclaration as? KtCallableDeclaration) - ?.valueParameters?.getOrNull(currentBehaviour.argumentIndex) + ?.valueParameters?.getOrNull(currentBehaviour.parameterIndex) parameter?.passToProcessor(mode.dropBehaviour()) } diff --git a/idea/src/org/jetbrains/kotlin/idea/slicer/LambdaCallsBehaviour.kt b/idea/src/org/jetbrains/kotlin/idea/slicer/LambdaCallsBehaviour.kt index d9e0d26a894fc..3f7679c5a5495 100644 --- a/idea/src/org/jetbrains/kotlin/idea/slicer/LambdaCallsBehaviour.kt +++ b/idea/src/org/jetbrains/kotlin/idea/slicer/LambdaCallsBehaviour.kt @@ -34,5 +34,12 @@ data class LambdaCallsBehaviour(private val sliceProducer: SliceProducer) : Kotl get() = KotlinBundle.message("slicer.text.tracking.lambda.calls") override val testPresentationPrefix: String - get() = "[LAMBDA CALLS] " + get() = buildString { + append("[LAMBDA CALLS") + sliceProducer.testPresentation?.let { + append(" ") + append(it) + } + append("] ") + } } \ No newline at end of file diff --git a/idea/src/org/jetbrains/kotlin/idea/slicer/LambdaArgumentInflowBehaviour.kt b/idea/src/org/jetbrains/kotlin/idea/slicer/LambdaParameterInflowBehaviour.kt similarity index 83% rename from idea/src/org/jetbrains/kotlin/idea/slicer/LambdaArgumentInflowBehaviour.kt rename to idea/src/org/jetbrains/kotlin/idea/slicer/LambdaParameterInflowBehaviour.kt index d5e141e6e265c..8eaff3817cd04 100644 --- a/idea/src/org/jetbrains/kotlin/idea/slicer/LambdaArgumentInflowBehaviour.kt +++ b/idea/src/org/jetbrains/kotlin/idea/slicer/LambdaParameterInflowBehaviour.kt @@ -9,7 +9,7 @@ import org.jetbrains.kotlin.idea.KotlinBundle import org.jetbrains.kotlin.idea.findUsages.handlers.SliceUsageProcessor import org.jetbrains.kotlin.psi.KtElement -data class LambdaArgumentInflowBehaviour(val argumentIndex: Int) : KotlinSliceAnalysisMode.Behaviour { +data class LambdaParameterInflowBehaviour(val parameterIndex: Int) : KotlinSliceAnalysisMode.Behaviour { override fun processUsages(element: KtElement, parent: KotlinSliceUsage, uniqueProcessor: SliceUsageProcessor) { InflowSlicer(element, uniqueProcessor, parent).processChildren(parent.forcedExpressionMode) } @@ -18,5 +18,5 @@ data class LambdaArgumentInflowBehaviour(val argumentIndex: Int) : KotlinSliceAn get() = KotlinBundle.message("slicer.text.tracking.lambda.argument") override val testPresentationPrefix: String - get() = "[LAMBDA ARGUMENT IN] " + get() = "[LAMBDA PARAMETER #$parameterIndex] " } \ No newline at end of file diff --git a/idea/src/org/jetbrains/kotlin/idea/slicer/LambdaReceiverInflowBehaviour.kt b/idea/src/org/jetbrains/kotlin/idea/slicer/LambdaReceiverInflowBehaviour.kt index 9727a228c3915..291a4907fc4e4 100644 --- a/idea/src/org/jetbrains/kotlin/idea/slicer/LambdaReceiverInflowBehaviour.kt +++ b/idea/src/org/jetbrains/kotlin/idea/slicer/LambdaReceiverInflowBehaviour.kt @@ -18,7 +18,7 @@ object LambdaReceiverInflowBehaviour : KotlinSliceAnalysisMode.Behaviour { get() = KotlinBundle.message("slicer.text.tracking.lambda.receiver") override val testPresentationPrefix: String - get() = "[LAMBDA RECEIVER IN] " + get() = "[LAMBDA RECEIVER] " override fun equals(other: Any?) = other === this override fun hashCode() = 0 diff --git a/idea/src/org/jetbrains/kotlin/idea/slicer/OutflowSlicer.kt b/idea/src/org/jetbrains/kotlin/idea/slicer/OutflowSlicer.kt index 4415cba799d2a..ff1434719fa70 100644 --- a/idea/src/org/jetbrains/kotlin/idea/slicer/OutflowSlicer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/slicer/OutflowSlicer.kt @@ -227,9 +227,9 @@ class OutflowSlicer( if (receiverType == null || !receiverType.isFunctionType) return val isExtension = receiverType.isExtensionFunctionType val shift = if (isExtension) 1 else 0 - val argumentIndex = parameterDescriptor.index - shift - val newMode = if (argumentIndex >= 0) - mode.withBehaviour(LambdaArgumentInflowBehaviour(argumentIndex)) + val parameterIndex = parameterDescriptor.index - shift + val newMode = if (parameterIndex >= 0) + mode.withBehaviour(LambdaParameterInflowBehaviour(parameterIndex)) else mode.withBehaviour(LambdaReceiverInflowBehaviour) receiver.passToProcessor(newMode) diff --git a/idea/src/org/jetbrains/kotlin/idea/slicer/ReceiverSliceProducer.kt b/idea/src/org/jetbrains/kotlin/idea/slicer/ReceiverSliceProducer.kt index 9d3eaaeacb9b1..4c8c66e4b6974 100644 --- a/idea/src/org/jetbrains/kotlin/idea/slicer/ReceiverSliceProducer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/slicer/ReceiverSliceProducer.kt @@ -57,6 +57,9 @@ object ReceiverSliceProducer : SliceProducer { } } + override val testPresentation: String? + get() = "RECEIVER" + override fun equals(other: Any?) = other === this override fun hashCode() = 0 } \ No newline at end of file diff --git a/idea/src/org/jetbrains/kotlin/idea/slicer/SliceProducer.kt b/idea/src/org/jetbrains/kotlin/idea/slicer/SliceProducer.kt index db8d0571679a4..8addb8ded94a3 100644 --- a/idea/src/org/jetbrains/kotlin/idea/slicer/SliceProducer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/slicer/SliceProducer.kt @@ -12,6 +12,8 @@ import org.jetbrains.kotlin.idea.findUsages.handlers.SliceUsageProcessor interface SliceProducer { fun produce(usage: UsageInfo, mode: KotlinSliceAnalysisMode, parent: SliceUsage): Collection? + val testPresentation: String? + override fun equals(other: Any?): Boolean override fun hashCode(): Int @@ -20,6 +22,9 @@ interface SliceProducer { return null } + override val testPresentation: String? + get() = null + override fun equals(other: Any?) = other === this override fun hashCode() = 0 } diff --git a/idea/testData/slicer/inflow/anonymousFunBodyExpression.leafGroups.txt b/idea/testData/slicer/inflow/anonymousFunBodyExpression.leafGroups.txt index 684e3af93f6ab..86641a4fb6c55 100644 --- a/idea/testData/slicer/inflow/anonymousFunBodyExpression.leafGroups.txt +++ b/idea/testData/slicer/inflow/anonymousFunBodyExpression.leafGroups.txt @@ -9,7 +9,7 @@ 8 val x = foo(fun(n: Int) = n) 8 val x = foo(fun(n: Int) = n) 8 val x = foo(fun(n: Int) = n) -8 [LAMBDA CALLS] val x = foo(fun(n: Int) = n) -3 [LAMBDA CALLS] fun foo(f: (Int) -> Int): Int { +8 [LAMBDA CALLS ARGUMENT #0] val x = foo(fun(n: Int) = n) +3 [LAMBDA CALLS ARGUMENT #0] fun foo(f: (Int) -> Int): Int { 4 return f(1) diff --git a/idea/testData/slicer/inflow/anonymousFunBodyExpression.results.txt b/idea/testData/slicer/inflow/anonymousFunBodyExpression.results.txt index 6cda09e4fa117..1cb5b05c23d3d 100644 --- a/idea/testData/slicer/inflow/anonymousFunBodyExpression.results.txt +++ b/idea/testData/slicer/inflow/anonymousFunBodyExpression.results.txt @@ -8,6 +8,6 @@ 8 val x = foo(fun(n: Int) = n) 8 val x = foo(fun(n: Int) = n) 8 val x = foo(fun(n: Int) = n) -8 [LAMBDA CALLS] val x = foo(fun(n: Int) = n) -3 [LAMBDA CALLS] fun foo(f: (Int) -> Int): Int { +8 [LAMBDA CALLS ARGUMENT #0] val x = foo(fun(n: Int) = n) +3 [LAMBDA CALLS ARGUMENT #0] fun foo(f: (Int) -> Int): Int { 4 return f(1) diff --git a/idea/testData/slicer/inflow/anonymousFunReturnExpression.leafGroups.txt b/idea/testData/slicer/inflow/anonymousFunReturnExpression.leafGroups.txt index 64453afb1f1b5..48be750ee4d4c 100644 --- a/idea/testData/slicer/inflow/anonymousFunReturnExpression.leafGroups.txt +++ b/idea/testData/slicer/inflow/anonymousFunReturnExpression.leafGroups.txt @@ -9,7 +9,7 @@ 8 val x = foo(fun(n: Int): Int { return n }) 8 val x = foo(fun(n: Int): Int { return n }) 8 val x = foo(fun(n: Int): Int { return n }) -8 [LAMBDA CALLS] val x = foo(fun(n: Int): Int { return n }) -3 [LAMBDA CALLS] fun foo(f: (Int) -> Int): Int { +8 [LAMBDA CALLS ARGUMENT #0] val x = foo(fun(n: Int): Int { return n }) +3 [LAMBDA CALLS ARGUMENT #0] fun foo(f: (Int) -> Int): Int { 4 return f(1) diff --git a/idea/testData/slicer/inflow/anonymousFunReturnExpression.results.txt b/idea/testData/slicer/inflow/anonymousFunReturnExpression.results.txt index 95ba8dfb5dbd4..7be6b76e83504 100644 --- a/idea/testData/slicer/inflow/anonymousFunReturnExpression.results.txt +++ b/idea/testData/slicer/inflow/anonymousFunReturnExpression.results.txt @@ -8,6 +8,6 @@ 8 val x = foo(fun(n: Int): Int { return n }) 8 val x = foo(fun(n: Int): Int { return n }) 8 val x = foo(fun(n: Int): Int { return n }) -8 [LAMBDA CALLS] val x = foo(fun(n: Int): Int { return n }) -3 [LAMBDA CALLS] fun foo(f: (Int) -> Int): Int { +8 [LAMBDA CALLS ARGUMENT #0] val x = foo(fun(n: Int): Int { return n }) +3 [LAMBDA CALLS ARGUMENT #0] fun foo(f: (Int) -> Int): Int { 4 return f(1) diff --git a/idea/testData/slicer/inflow/anonymousFunctionParameter.leafGroups.txt b/idea/testData/slicer/inflow/anonymousFunctionParameter.leafGroups.txt index ed09a376a8edf..203793c7ba3c4 100644 --- a/idea/testData/slicer/inflow/anonymousFunctionParameter.leafGroups.txt +++ b/idea/testData/slicer/inflow/anonymousFunctionParameter.leafGroups.txt @@ -2,7 +2,7 @@ 9 val v = value 9 val v = value 8 foo(fun(value: Int) { -8 [LAMBDA CALLS] foo(fun(value: Int) { -3 [LAMBDA CALLS] fun foo(f: (Int) -> Unit) { +8 [LAMBDA CALLS ARGUMENT #0] foo(fun(value: Int) { +3 [LAMBDA CALLS ARGUMENT #0] fun foo(f: (Int) -> Unit) { 4 f(1) diff --git a/idea/testData/slicer/inflow/anonymousFunctionParameter.results.txt b/idea/testData/slicer/inflow/anonymousFunctionParameter.results.txt index 527b2743a3c20..b0719353375bb 100644 --- a/idea/testData/slicer/inflow/anonymousFunctionParameter.results.txt +++ b/idea/testData/slicer/inflow/anonymousFunctionParameter.results.txt @@ -1,6 +1,6 @@ 9 val v = value 9 val v = value 8 foo(fun(value: Int) { -8 [LAMBDA CALLS] foo(fun(value: Int) { -3 [LAMBDA CALLS] fun foo(f: (Int) -> Unit) { +8 [LAMBDA CALLS ARGUMENT #0] foo(fun(value: Int) { +3 [LAMBDA CALLS ARGUMENT #0] fun foo(f: (Int) -> Unit) { 4 f(1) diff --git a/idea/testData/slicer/inflow/doubleLambdaResult.leafGroups.txt b/idea/testData/slicer/inflow/doubleLambdaResult.leafGroups.txt index 9d92db5af74fd..64f6f9b9104fc 100644 --- a/idea/testData/slicer/inflow/doubleLambdaResult.leafGroups.txt +++ b/idea/testData/slicer/inflow/doubleLambdaResult.leafGroups.txt @@ -11,11 +11,11 @@ 8 [LAMBDA IN] val x = foo(1, 2) { { it } } 8 val x = foo(1, 2) { { it } } 8 val x = foo(1, 2) { { it } } -8 [LAMBDA CALLS] val x = foo(1, 2) { { it } } -8 [LAMBDA CALLS] val x = foo(1, 2) { { it } } -8 [LAMBDA CALLS] [LAMBDA CALLS] val x = foo(1, 2) { { it } } -3 [LAMBDA CALLS] [LAMBDA CALLS] fun foo(a: Int, b: Int, f: (Int) -> (Int) -> Int): Int { -4 [LAMBDA CALLS] return f(a)(b) +8 [LAMBDA CALLS ARGUMENT #0] val x = foo(1, 2) { { it } } +8 [LAMBDA CALLS ARGUMENT #0] val x = foo(1, 2) { { it } } +8 [LAMBDA CALLS] [LAMBDA CALLS ARGUMENT #0] val x = foo(1, 2) { { it } } +3 [LAMBDA CALLS] [LAMBDA CALLS ARGUMENT #0] fun foo(a: Int, b: Int, f: (Int) -> (Int) -> Int): Int { +4 [LAMBDA CALLS ARGUMENT #0] return f(a)(b) 4 return f(a)(b) 3 fun foo(a: Int, b: Int, f: (Int) -> (Int) -> Int): Int { 8 val x = foo(1, 2) { { it } } diff --git a/idea/testData/slicer/inflow/doubleLambdaResult.results.txt b/idea/testData/slicer/inflow/doubleLambdaResult.results.txt index f086bb1482874..f878159826a99 100644 --- a/idea/testData/slicer/inflow/doubleLambdaResult.results.txt +++ b/idea/testData/slicer/inflow/doubleLambdaResult.results.txt @@ -10,11 +10,11 @@ 8 [LAMBDA IN] val x = foo(1, 2) { { it } } 8 val x = foo(1, 2) { { it } } 8 val x = foo(1, 2) { { it } } -8 [LAMBDA CALLS] val x = foo(1, 2) { { it } } -8 [LAMBDA CALLS] val x = foo(1, 2) { { it } } -8 [LAMBDA CALLS] [LAMBDA CALLS] val x = foo(1, 2) { { it } } -3 [LAMBDA CALLS] [LAMBDA CALLS] fun foo(a: Int, b: Int, f: (Int) -> (Int) -> Int): Int { -4 [LAMBDA CALLS] return f(a)(b) +8 [LAMBDA CALLS ARGUMENT #0] val x = foo(1, 2) { { it } } +8 [LAMBDA CALLS ARGUMENT #0] val x = foo(1, 2) { { it } } +8 [LAMBDA CALLS] [LAMBDA CALLS ARGUMENT #0] val x = foo(1, 2) { { it } } +3 [LAMBDA CALLS] [LAMBDA CALLS ARGUMENT #0] fun foo(a: Int, b: Int, f: (Int) -> (Int) -> Int): Int { +4 [LAMBDA CALLS ARGUMENT #0] return f(a)(b) 4 return f(a)(b) 3 fun foo(a: Int, b: Int, f: (Int) -> (Int) -> Int): Int { 8 val x = foo(1, 2) { { it } } diff --git a/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.leafGroups.txt b/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.leafGroups.txt index bc76f81556186..993c586492288 100644 --- a/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.leafGroups.txt +++ b/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.leafGroups.txt @@ -1,18 +1,18 @@ 4 f("", 1) 15 val v = it -14 [LAMBDA CALLS] foo { -3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { +14 [LAMBDA CALLS ARGUMENT #0 EXTENSION] foo { +3 [LAMBDA CALLS ARGUMENT #0 EXTENSION] fun foo(f: String.(Int) -> Unit) { 4 f("", 1) 6 "".f(2) 15 val v = it -14 [LAMBDA CALLS] foo { -3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { +14 [LAMBDA CALLS ARGUMENT #0 EXTENSION] foo { +3 [LAMBDA CALLS ARGUMENT #0 EXTENSION] fun foo(f: String.(Int) -> Unit) { 6 "".f(2) 9 f(3) 15 val v = it -14 [LAMBDA CALLS] foo { -3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { +14 [LAMBDA CALLS ARGUMENT #0 EXTENSION] foo { +3 [LAMBDA CALLS ARGUMENT #0 EXTENSION] fun foo(f: String.(Int) -> Unit) { 9 f(3) diff --git a/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.results.txt b/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.results.txt index 0afcb0bf3fac4..719293b6c5242 100644 --- a/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.results.txt +++ b/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.results.txt @@ -1,6 +1,6 @@ 15 val v = it -14 [LAMBDA CALLS] foo { -3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { +14 [LAMBDA CALLS ARGUMENT #0 EXTENSION] foo { +3 [LAMBDA CALLS ARGUMENT #0 EXTENSION] fun foo(f: String.(Int) -> Unit) { 4 f("", 1) 6 "".f(2) 9 f(3) diff --git a/idea/testData/slicer/inflow/extensionLambdaParameter.leafGroups.txt b/idea/testData/slicer/inflow/extensionLambdaParameter.leafGroups.txt index 9f625c5ca9f95..d0b5c6c215a14 100644 --- a/idea/testData/slicer/inflow/extensionLambdaParameter.leafGroups.txt +++ b/idea/testData/slicer/inflow/extensionLambdaParameter.leafGroups.txt @@ -1,21 +1,21 @@ 4 f("", 1) 15 val v = i 14 foo { i -> -14 [LAMBDA CALLS] foo { i -> -3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { +14 [LAMBDA CALLS ARGUMENT #0 EXTENSION] foo { i -> +3 [LAMBDA CALLS ARGUMENT #0 EXTENSION] fun foo(f: String.(Int) -> Unit) { 4 f("", 1) 6 "".f(2) 15 val v = i 14 foo { i -> -14 [LAMBDA CALLS] foo { i -> -3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { +14 [LAMBDA CALLS ARGUMENT #0 EXTENSION] foo { i -> +3 [LAMBDA CALLS ARGUMENT #0 EXTENSION] fun foo(f: String.(Int) -> Unit) { 6 "".f(2) 9 f(3) 15 val v = i 14 foo { i -> -14 [LAMBDA CALLS] foo { i -> -3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { +14 [LAMBDA CALLS ARGUMENT #0 EXTENSION] foo { i -> +3 [LAMBDA CALLS ARGUMENT #0 EXTENSION] fun foo(f: String.(Int) -> Unit) { 9 f(3) diff --git a/idea/testData/slicer/inflow/extensionLambdaParameter.results.txt b/idea/testData/slicer/inflow/extensionLambdaParameter.results.txt index f87457e46a3bb..28f7e32deb7f0 100644 --- a/idea/testData/slicer/inflow/extensionLambdaParameter.results.txt +++ b/idea/testData/slicer/inflow/extensionLambdaParameter.results.txt @@ -1,7 +1,7 @@ 15 val v = i 14 foo { i -> -14 [LAMBDA CALLS] foo { i -> -3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { +14 [LAMBDA CALLS ARGUMENT #0 EXTENSION] foo { i -> +3 [LAMBDA CALLS ARGUMENT #0 EXTENSION] fun foo(f: String.(Int) -> Unit) { 4 f("", 1) 6 "".f(2) 9 f(3) diff --git a/idea/testData/slicer/inflow/extensionLambdaReceiver.leafGroups.txt b/idea/testData/slicer/inflow/extensionLambdaReceiver.leafGroups.txt index 57bf3f8e49d20..047beb80bb0d9 100644 --- a/idea/testData/slicer/inflow/extensionLambdaReceiver.leafGroups.txt +++ b/idea/testData/slicer/inflow/extensionLambdaReceiver.leafGroups.txt @@ -1,8 +1,8 @@ 4 with("A") { 5 val v = this 5 val v = this -4 [LAMBDA CALLS] with("A") { -9 (INLINE CALL with) [LAMBDA CALLS] inline fun with(receiver: T, block: T.() -> R): R { +4 [LAMBDA CALLS RECEIVER] with("A") { +9 (INLINE CALL with) [LAMBDA CALLS RECEIVER] inline fun with(receiver: T, block: T.() -> R): R { 10 (INLINE CALL with) return receiver.block() 9 (INLINE CALL with) inline fun with(receiver: T, block: T.() -> R): R { 4 with("A") { diff --git a/idea/testData/slicer/inflow/extensionLambdaReceiver.results.txt b/idea/testData/slicer/inflow/extensionLambdaReceiver.results.txt index 1243168bbab80..85e289d745c74 100644 --- a/idea/testData/slicer/inflow/extensionLambdaReceiver.results.txt +++ b/idea/testData/slicer/inflow/extensionLambdaReceiver.results.txt @@ -1,7 +1,7 @@ 5 val v = this 5 val v = this -4 [LAMBDA CALLS] with("A") { -9 (INLINE CALL with) [LAMBDA CALLS] inline fun with(receiver: T, block: T.() -> R): R { +4 [LAMBDA CALLS RECEIVER] with("A") { +9 (INLINE CALL with) [LAMBDA CALLS RECEIVER] inline fun with(receiver: T, block: T.() -> R): R { 10 (INLINE CALL with) return receiver.block() 9 (INLINE CALL with) inline fun with(receiver: T, block: T.() -> R): R { 4 with("A") { diff --git a/idea/testData/slicer/inflow/inlineFunctionManyCalls.leafGroups.txt b/idea/testData/slicer/inflow/inlineFunctionManyCalls.leafGroups.txt index 5d4506757ef6f..6d4617c1d3125 100644 --- a/idea/testData/slicer/inflow/inlineFunctionManyCalls.leafGroups.txt +++ b/idea/testData/slicer/inflow/inlineFunctionManyCalls.leafGroups.txt @@ -1,8 +1,8 @@ 35 "D".letNoInline { 3 fun Any.extensionFun() { 36 it.extensionFun() -35 [LAMBDA CALLS] "D".letNoInline { -58 [LAMBDA CALLS] fun T.letNoInline(block: (T) -> R): R { +35 [LAMBDA CALLS ARGUMENT #0] "D".letNoInline { +58 [LAMBDA CALLS ARGUMENT #0] fun T.letNoInline(block: (T) -> R): R { 59 return block(this) 58 fun T.letNoInline(block: (T) -> R): R { 35 "D".letNoInline { @@ -10,8 +10,8 @@ 39 "C".letNoInline { 3 fun Any.extensionFun() { 36 it.extensionFun() -35 [LAMBDA CALLS] "D".letNoInline { -58 [LAMBDA CALLS] fun T.letNoInline(block: (T) -> R): R { +35 [LAMBDA CALLS ARGUMENT #0] "D".letNoInline { +58 [LAMBDA CALLS ARGUMENT #0] fun T.letNoInline(block: (T) -> R): R { 59 return block(this) 58 fun T.letNoInline(block: (T) -> R): R { 39 "C".letNoInline { @@ -19,32 +19,32 @@ 27 "A".let { 3 fun Any.extensionFun() { 28 it.extensionFun() -27 [LAMBDA CALLS] "A".let { -49 (INLINE CALL let) [LAMBDA CALLS] inline fun T.let(block: (T) -> R): R { +27 [LAMBDA CALLS ARGUMENT #0] "A".let { +49 (INLINE CALL let) [LAMBDA CALLS ARGUMENT #0] inline fun T.let(block: (T) -> R): R { 50 (INLINE CALL let) return block(this) 49 (INLINE CALL let) inline fun T.let(block: (T) -> R): R { 27 "A".let { 19 withNoInline(1) { 3 fun Any.extensionFun() { -19 [LAMBDA CALLS] withNoInline(1) { -53 [LAMBDA CALLS] fun withNoInline(receiver: T, block: T.() -> R): R { +19 [LAMBDA CALLS RECEIVER] withNoInline(1) { +53 [LAMBDA CALLS RECEIVER] fun withNoInline(receiver: T, block: T.() -> R): R { 54 val result = receiver.block() 53 fun withNoInline(receiver: T, block: T.() -> R): R { 19 withNoInline(1) { 7 with(123) { 3 fun Any.extensionFun() { -7 [LAMBDA CALLS] with(123) { -44 (INLINE CALL with) [LAMBDA CALLS] inline fun with(receiver: T, block: T.() -> R): R { +7 [LAMBDA CALLS RECEIVER] with(123) { +44 (INLINE CALL with) [LAMBDA CALLS RECEIVER] inline fun with(receiver: T, block: T.() -> R): R { 45 (INLINE CALL with) val result = receiver.block() 44 (INLINE CALL with) inline fun with(receiver: T, block: T.() -> R): R { 7 with(123) { 23 withNoInline(2) { 3 fun Any.extensionFun() { -19 [LAMBDA CALLS] withNoInline(1) { -53 [LAMBDA CALLS] fun withNoInline(receiver: T, block: T.() -> R): R { +19 [LAMBDA CALLS RECEIVER] withNoInline(1) { +53 [LAMBDA CALLS RECEIVER] fun withNoInline(receiver: T, block: T.() -> R): R { 54 val result = receiver.block() 53 fun withNoInline(receiver: T, block: T.() -> R): R { 23 withNoInline(2) { @@ -52,8 +52,8 @@ 11 with(456) { 3 fun Any.extensionFun() { 12 this.extensionFun() -11 [LAMBDA CALLS] with(456) { -44 (INLINE CALL with) [LAMBDA CALLS] inline fun with(receiver: T, block: T.() -> R): R { +11 [LAMBDA CALLS RECEIVER] with(456) { +44 (INLINE CALL with) [LAMBDA CALLS RECEIVER] inline fun with(receiver: T, block: T.() -> R): R { 45 (INLINE CALL with) val result = receiver.block() 44 (INLINE CALL with) inline fun with(receiver: T, block: T.() -> R): R { 11 with(456) { diff --git a/idea/testData/slicer/inflow/inlineFunctionManyCalls.nullnessGroups.txt b/idea/testData/slicer/inflow/inlineFunctionManyCalls.nullnessGroups.txt index 3f8b0244afa87..550ab3e5010eb 100644 --- a/idea/testData/slicer/inflow/inlineFunctionManyCalls.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/inlineFunctionManyCalls.nullnessGroups.txt @@ -1,8 +1,8 @@ [NotNull Values] 7 with(123) { 3 fun Any.extensionFun() { -7 [LAMBDA CALLS] with(123) { -44 (INLINE CALL with) [LAMBDA CALLS] inline fun with(receiver: T, block: T.() -> R): R { +7 [LAMBDA CALLS RECEIVER] with(123) { +44 (INLINE CALL with) [LAMBDA CALLS RECEIVER] inline fun with(receiver: T, block: T.() -> R): R { 45 (INLINE CALL with) val result = receiver.block() 44 (INLINE CALL with) inline fun with(receiver: T, block: T.() -> R): R { 7 with(123) { @@ -11,15 +11,15 @@ 12 this.extensionFun() 19 withNoInline(1) { 3 fun Any.extensionFun() { -19 [LAMBDA CALLS] withNoInline(1) { -53 [LAMBDA CALLS] fun withNoInline(receiver: T, block: T.() -> R): R { +19 [LAMBDA CALLS RECEIVER] withNoInline(1) { +53 [LAMBDA CALLS RECEIVER] fun withNoInline(receiver: T, block: T.() -> R): R { 54 val result = receiver.block() 53 fun withNoInline(receiver: T, block: T.() -> R): R { 19 withNoInline(1) { 23 withNoInline(2) { 3 fun Any.extensionFun() { -19 [LAMBDA CALLS] withNoInline(1) { -53 [LAMBDA CALLS] fun withNoInline(receiver: T, block: T.() -> R): R { +19 [LAMBDA CALLS RECEIVER] withNoInline(1) { +53 [LAMBDA CALLS RECEIVER] fun withNoInline(receiver: T, block: T.() -> R): R { 54 val result = receiver.block() 53 fun withNoInline(receiver: T, block: T.() -> R): R { 23 withNoInline(2) { diff --git a/idea/testData/slicer/inflow/inlineFunctionManyCalls.results.txt b/idea/testData/slicer/inflow/inlineFunctionManyCalls.results.txt index 5f40fb9cc74e8..04afb7118d3eb 100644 --- a/idea/testData/slicer/inflow/inlineFunctionManyCalls.results.txt +++ b/idea/testData/slicer/inflow/inlineFunctionManyCalls.results.txt @@ -1,30 +1,30 @@ 3 fun Any.extensionFun() { -7 [LAMBDA CALLS] with(123) { -44 (INLINE CALL with) [LAMBDA CALLS] inline fun with(receiver: T, block: T.() -> R): R { +7 [LAMBDA CALLS RECEIVER] with(123) { +44 (INLINE CALL with) [LAMBDA CALLS RECEIVER] inline fun with(receiver: T, block: T.() -> R): R { 45 (INLINE CALL with) val result = receiver.block() 44 (INLINE CALL with) inline fun with(receiver: T, block: T.() -> R): R { 7 with(123) { 12 this.extensionFun() -11 [LAMBDA CALLS] with(456) { -44 (INLINE CALL with) [LAMBDA CALLS] inline fun with(receiver: T, block: T.() -> R): R { +11 [LAMBDA CALLS RECEIVER] with(456) { +44 (INLINE CALL with) [LAMBDA CALLS RECEIVER] inline fun with(receiver: T, block: T.() -> R): R { 45 (INLINE CALL with) val result = receiver.block() 44 (INLINE CALL with) inline fun with(receiver: T, block: T.() -> R): R { 11 with(456) { -19 [LAMBDA CALLS] withNoInline(1) { -53 [LAMBDA CALLS] fun withNoInline(receiver: T, block: T.() -> R): R { +19 [LAMBDA CALLS RECEIVER] withNoInline(1) { +53 [LAMBDA CALLS RECEIVER] fun withNoInline(receiver: T, block: T.() -> R): R { 54 val result = receiver.block() 53 fun withNoInline(receiver: T, block: T.() -> R): R { 19 withNoInline(1) { 23 withNoInline(2) { 28 it.extensionFun() -27 [LAMBDA CALLS] "A".let { -49 (INLINE CALL let) [LAMBDA CALLS] inline fun T.let(block: (T) -> R): R { +27 [LAMBDA CALLS ARGUMENT #0] "A".let { +49 (INLINE CALL let) [LAMBDA CALLS ARGUMENT #0] inline fun T.let(block: (T) -> R): R { 50 (INLINE CALL let) return block(this) 49 (INLINE CALL let) inline fun T.let(block: (T) -> R): R { 27 "A".let { 36 it.extensionFun() -35 [LAMBDA CALLS] "D".letNoInline { -58 [LAMBDA CALLS] fun T.letNoInline(block: (T) -> R): R { +35 [LAMBDA CALLS ARGUMENT #0] "D".letNoInline { +58 [LAMBDA CALLS ARGUMENT #0] fun T.letNoInline(block: (T) -> R): R { 59 return block(this) 58 fun T.letNoInline(block: (T) -> R): R { 35 "D".letNoInline { diff --git a/idea/testData/slicer/inflow/lambdaImplicitParameter.leafGroups.txt b/idea/testData/slicer/inflow/lambdaImplicitParameter.leafGroups.txt index 74c485a47eced..5cbea6bf2fe13 100644 --- a/idea/testData/slicer/inflow/lambdaImplicitParameter.leafGroups.txt +++ b/idea/testData/slicer/inflow/lambdaImplicitParameter.leafGroups.txt @@ -1,6 +1,6 @@ 4 f(1) 9 val v = it -8 [LAMBDA CALLS] foo { -3 [LAMBDA CALLS] fun foo(f: (Int) -> Unit) { +8 [LAMBDA CALLS ARGUMENT #0] foo { +3 [LAMBDA CALLS ARGUMENT #0] fun foo(f: (Int) -> Unit) { 4 f(1) diff --git a/idea/testData/slicer/inflow/lambdaImplicitParameter.results.txt b/idea/testData/slicer/inflow/lambdaImplicitParameter.results.txt index 29383bcc54e2a..4a221edec8582 100644 --- a/idea/testData/slicer/inflow/lambdaImplicitParameter.results.txt +++ b/idea/testData/slicer/inflow/lambdaImplicitParameter.results.txt @@ -1,4 +1,4 @@ 9 val v = it -8 [LAMBDA CALLS] foo { -3 [LAMBDA CALLS] fun foo(f: (Int) -> Unit) { +8 [LAMBDA CALLS ARGUMENT #0] foo { +3 [LAMBDA CALLS ARGUMENT #0] fun foo(f: (Int) -> Unit) { 4 f(1) diff --git a/idea/testData/slicer/inflow/lambdaParameter.leafGroups.txt b/idea/testData/slicer/inflow/lambdaParameter.leafGroups.txt index a8566b9388e29..bcfb66420fa25 100644 --- a/idea/testData/slicer/inflow/lambdaParameter.leafGroups.txt +++ b/idea/testData/slicer/inflow/lambdaParameter.leafGroups.txt @@ -1,7 +1,7 @@ 4 f(1) 9 val v = value 8 foo { value -> -8 [LAMBDA CALLS] foo { value -> -3 [LAMBDA CALLS] fun foo(f: (Int) -> Unit) { +8 [LAMBDA CALLS ARGUMENT #0] foo { value -> +3 [LAMBDA CALLS ARGUMENT #0] fun foo(f: (Int) -> Unit) { 4 f(1) diff --git a/idea/testData/slicer/inflow/lambdaParameter.results.txt b/idea/testData/slicer/inflow/lambdaParameter.results.txt index 310aec046503e..c723b61100074 100644 --- a/idea/testData/slicer/inflow/lambdaParameter.results.txt +++ b/idea/testData/slicer/inflow/lambdaParameter.results.txt @@ -1,5 +1,5 @@ 9 val v = value 8 foo { value -> -8 [LAMBDA CALLS] foo { value -> -3 [LAMBDA CALLS] fun foo(f: (Int) -> Unit) { +8 [LAMBDA CALLS ARGUMENT #0] foo { value -> +3 [LAMBDA CALLS ARGUMENT #0] fun foo(f: (Int) -> Unit) { 4 f(1) diff --git a/idea/testData/slicer/inflow/lambdaResult.leafGroups.txt b/idea/testData/slicer/inflow/lambdaResult.leafGroups.txt index e4f7a3b07fa77..b67a6270b0f0c 100644 --- a/idea/testData/slicer/inflow/lambdaResult.leafGroups.txt +++ b/idea/testData/slicer/inflow/lambdaResult.leafGroups.txt @@ -8,7 +8,7 @@ 8 [LAMBDA IN] val x = foo { it } 8 val x = foo { it } 8 val x = foo { it } -8 [LAMBDA CALLS] val x = foo { it } -3 [LAMBDA CALLS] fun foo(f: (Int) -> Int): Int { +8 [LAMBDA CALLS ARGUMENT #0] val x = foo { it } +3 [LAMBDA CALLS ARGUMENT #0] fun foo(f: (Int) -> Int): Int { 4 return f(1) diff --git a/idea/testData/slicer/inflow/lambdaResult.results.txt b/idea/testData/slicer/inflow/lambdaResult.results.txt index b6bc949f447e6..046eb0a9e72a3 100644 --- a/idea/testData/slicer/inflow/lambdaResult.results.txt +++ b/idea/testData/slicer/inflow/lambdaResult.results.txt @@ -7,6 +7,6 @@ 8 [LAMBDA IN] val x = foo { it } 8 val x = foo { it } 8 val x = foo { it } -8 [LAMBDA CALLS] val x = foo { it } -3 [LAMBDA CALLS] fun foo(f: (Int) -> Int): Int { +8 [LAMBDA CALLS ARGUMENT #0] val x = foo { it } +3 [LAMBDA CALLS ARGUMENT #0] fun foo(f: (Int) -> Int): Int { 4 return f(1) diff --git a/idea/testData/slicer/inflow/lambdaResultWithAssignments.leafGroups.txt b/idea/testData/slicer/inflow/lambdaResultWithAssignments.leafGroups.txt index 00573786d7806..f44f1998b007e 100644 --- a/idea/testData/slicer/inflow/lambdaResultWithAssignments.leafGroups.txt +++ b/idea/testData/slicer/inflow/lambdaResultWithAssignments.leafGroups.txt @@ -10,9 +10,9 @@ 9 [LAMBDA IN] val y = foo { it } 9 val y = foo { it } 9 val y = foo { it } -9 [LAMBDA CALLS] val y = foo { it } -3 [LAMBDA CALLS] fun foo(f: (Int) -> Int): Int { -4 [LAMBDA CALLS] val x = f -4 [LAMBDA CALLS] val x = f +9 [LAMBDA CALLS ARGUMENT #0] val y = foo { it } +3 [LAMBDA CALLS ARGUMENT #0] fun foo(f: (Int) -> Int): Int { +4 [LAMBDA CALLS ARGUMENT #0] val x = f +4 [LAMBDA CALLS ARGUMENT #0] val x = f 5 return x(1) diff --git a/idea/testData/slicer/inflow/lambdaResultWithAssignments.results.txt b/idea/testData/slicer/inflow/lambdaResultWithAssignments.results.txt index e37ef26d9674e..97b168d237843 100644 --- a/idea/testData/slicer/inflow/lambdaResultWithAssignments.results.txt +++ b/idea/testData/slicer/inflow/lambdaResultWithAssignments.results.txt @@ -9,8 +9,8 @@ 9 [LAMBDA IN] val y = foo { it } 9 val y = foo { it } 9 val y = foo { it } -9 [LAMBDA CALLS] val y = foo { it } -3 [LAMBDA CALLS] fun foo(f: (Int) -> Int): Int { -4 [LAMBDA CALLS] val x = f -4 [LAMBDA CALLS] val x = f +9 [LAMBDA CALLS ARGUMENT #0] val y = foo { it } +3 [LAMBDA CALLS ARGUMENT #0] fun foo(f: (Int) -> Int): Int { +4 [LAMBDA CALLS ARGUMENT #0] val x = f +4 [LAMBDA CALLS ARGUMENT #0] val x = f 5 return x(1) diff --git a/idea/testData/slicer/inflow/nonLocalReturn.leafGroups.txt b/idea/testData/slicer/inflow/nonLocalReturn.leafGroups.txt index ab4bc6d7bd138..1a4bd07895e6c 100644 --- a/idea/testData/slicer/inflow/nonLocalReturn.leafGroups.txt +++ b/idea/testData/slicer/inflow/nonLocalReturn.leafGroups.txt @@ -9,8 +9,8 @@ 5 fun bar(a: Int): Int = foo(a) { if (it > 0) it else return 0 } 5 fun bar(a: Int): Int = foo(a) { if (it > 0) it else return 0 } 5 fun bar(a: Int): Int = foo(a) { if (it > 0) it else return 0 } -5 [LAMBDA CALLS] fun bar(a: Int): Int = foo(a) { if (it > 0) it else return 0 } -3 (INLINE CALL foo) [LAMBDA CALLS] inline fun foo(a: Int, f: (Int) -> Int) = f(a) +5 [LAMBDA CALLS ARGUMENT #0] fun bar(a: Int): Int = foo(a) { if (it > 0) it else return 0 } +3 (INLINE CALL foo) [LAMBDA CALLS ARGUMENT #0] inline fun foo(a: Int, f: (Int) -> Int) = f(a) 3 (INLINE CALL foo) inline fun foo(a: Int, f: (Int) -> Int) = f(a) 3 (INLINE CALL foo) inline fun foo(a: Int, f: (Int) -> Int) = f(a) 5 fun bar(a: Int): Int = foo(a) { if (it > 0) it else return 0 } diff --git a/idea/testData/slicer/inflow/nonLocalReturn.results.txt b/idea/testData/slicer/inflow/nonLocalReturn.results.txt index a22bf7a34d85e..34d330161e202 100644 --- a/idea/testData/slicer/inflow/nonLocalReturn.results.txt +++ b/idea/testData/slicer/inflow/nonLocalReturn.results.txt @@ -8,8 +8,8 @@ 5 fun bar(a: Int): Int = foo(a) { if (it > 0) it else return 0 } 5 fun bar(a: Int): Int = foo(a) { if (it > 0) it else return 0 } 5 fun bar(a: Int): Int = foo(a) { if (it > 0) it else return 0 } -5 [LAMBDA CALLS] fun bar(a: Int): Int = foo(a) { if (it > 0) it else return 0 } -3 (INLINE CALL foo) [LAMBDA CALLS] inline fun foo(a: Int, f: (Int) -> Int) = f(a) +5 [LAMBDA CALLS ARGUMENT #0] fun bar(a: Int): Int = foo(a) { if (it > 0) it else return 0 } +3 (INLINE CALL foo) [LAMBDA CALLS ARGUMENT #0] inline fun foo(a: Int, f: (Int) -> Int) = f(a) 3 (INLINE CALL foo) inline fun foo(a: Int, f: (Int) -> Int) = f(a) 3 (INLINE CALL foo) inline fun foo(a: Int, f: (Int) -> Int) = f(a) 5 fun bar(a: Int): Int = foo(a) { if (it > 0) it else return 0 } diff --git a/idea/testData/slicer/inflow/onFunctionReceiverType.leafGroups.txt b/idea/testData/slicer/inflow/onFunctionReceiverType.leafGroups.txt index 730eb38e07935..38c6b506da8a5 100644 --- a/idea/testData/slicer/inflow/onFunctionReceiverType.leafGroups.txt +++ b/idea/testData/slicer/inflow/onFunctionReceiverType.leafGroups.txt @@ -17,8 +17,8 @@ 18 with(123) { 8 fun Any.extensionFun() { -18 [LAMBDA CALLS] with(123) { -27 (INLINE CALL with) [LAMBDA CALLS] inline fun with(receiver: T, block: T.() -> R): R { +18 [LAMBDA CALLS RECEIVER] with(123) { +27 (INLINE CALL with) [LAMBDA CALLS RECEIVER] inline fun with(receiver: T, block: T.() -> R): R { 28 (INLINE CALL with) return receiver.block() 27 (INLINE CALL with) inline fun with(receiver: T, block: T.() -> R): R { 18 with(123) { diff --git a/idea/testData/slicer/inflow/onFunctionReceiverType.nullnessGroups.txt b/idea/testData/slicer/inflow/onFunctionReceiverType.nullnessGroups.txt index 82765b28b4b14..b1e4390d4a55d 100644 --- a/idea/testData/slicer/inflow/onFunctionReceiverType.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/onFunctionReceiverType.nullnessGroups.txt @@ -7,8 +7,8 @@ 14 1.extensionFun() 18 with(123) { 8 fun Any.extensionFun() { -18 [LAMBDA CALLS] with(123) { -27 (INLINE CALL with) [LAMBDA CALLS] inline fun with(receiver: T, block: T.() -> R): R { +18 [LAMBDA CALLS RECEIVER] with(123) { +27 (INLINE CALL with) [LAMBDA CALLS RECEIVER] inline fun with(receiver: T, block: T.() -> R): R { 28 (INLINE CALL with) return receiver.block() 27 (INLINE CALL with) inline fun with(receiver: T, block: T.() -> R): R { 18 with(123) { diff --git a/idea/testData/slicer/inflow/onFunctionReceiverType.results.txt b/idea/testData/slicer/inflow/onFunctionReceiverType.results.txt index 195f45364ee30..f807be99e14bf 100644 --- a/idea/testData/slicer/inflow/onFunctionReceiverType.results.txt +++ b/idea/testData/slicer/inflow/onFunctionReceiverType.results.txt @@ -4,8 +4,8 @@ 24 "A".foo() 12 "".extensionFun() 14 1.extensionFun() -18 [LAMBDA CALLS] with(123) { -27 (INLINE CALL with) [LAMBDA CALLS] inline fun with(receiver: T, block: T.() -> R): R { +18 [LAMBDA CALLS RECEIVER] with(123) { +27 (INLINE CALL with) [LAMBDA CALLS RECEIVER] inline fun with(receiver: T, block: T.() -> R): R { 28 (INLINE CALL with) return receiver.block() 27 (INLINE CALL with) inline fun with(receiver: T, block: T.() -> R): R { 18 with(123) { diff --git a/idea/testData/slicer/outflow/invokeExtensionLambda.results.txt b/idea/testData/slicer/outflow/invokeExtensionLambda.results.txt index 9a3a0e6f40167..79bb59916d36d 100644 --- a/idea/testData/slicer/outflow/invokeExtensionLambda.results.txt +++ b/idea/testData/slicer/outflow/invokeExtensionLambda.results.txt @@ -2,9 +2,9 @@ 4 val v1 = f(p, { this }) 11 fun f(receiver: String, lambda: String.() -> String): String { 12 return lambda.invoke(receiver) -12 [LAMBDA RECEIVER IN] return lambda.invoke(receiver) -11 [LAMBDA RECEIVER IN] fun f(receiver: String, lambda: String.() -> String): String { -4 [LAMBDA RECEIVER IN] val v1 = f(p, { this }) +12 [LAMBDA RECEIVER] return lambda.invoke(receiver) +11 [LAMBDA RECEIVER] fun f(receiver: String, lambda: String.() -> String): String { +4 [LAMBDA RECEIVER] val v1 = f(p, { this }) 4 val v1 = f(p, { this }) 4 val v1 = f(p, { this }) 4 [LAMBDA CALLS] val v1 = f(p, { this }) @@ -17,9 +17,9 @@ 6 val v2 = g("a", "b", p, { p1, p2 -> p2 }) 15 fun g(a: String, b: String, c: String, lambda: String.(String, String) -> String): String { 16 return lambda.invoke(a, b, c) -16 [LAMBDA ARGUMENT IN] return lambda.invoke(a, b, c) -15 [LAMBDA ARGUMENT IN] fun g(a: String, b: String, c: String, lambda: String.(String, String) -> String): String { -6 [LAMBDA ARGUMENT IN] val v2 = g("a", "b", p, { p1, p2 -> p2 }) +16 [LAMBDA PARAMETER #1] return lambda.invoke(a, b, c) +15 [LAMBDA PARAMETER #1] fun g(a: String, b: String, c: String, lambda: String.(String, String) -> String): String { +6 [LAMBDA PARAMETER #1] val v2 = g("a", "b", p, { p1, p2 -> p2 }) 6 val v2 = g("a", "b", p, { p1, p2 -> p2 }) 6 val v2 = g("a", "b", p, { p1, p2 -> p2 }) 6 val v2 = g("a", "b", p, { p1, p2 -> p2 }) @@ -33,9 +33,9 @@ 8 val v3 = inlineF(p, { this }) 19 (INLINE CALL inlineF) inline fun inlineF(receiver: String, lambda: String.() -> String): String { 20 (INLINE CALL inlineF) return lambda.invoke(receiver) -20 (INLINE CALL inlineF) [LAMBDA RECEIVER IN] return lambda.invoke(receiver) -19 (INLINE CALL inlineF) [LAMBDA RECEIVER IN] inline fun inlineF(receiver: String, lambda: String.() -> String): String { -8 [LAMBDA RECEIVER IN] val v3 = inlineF(p, { this }) +20 (INLINE CALL inlineF) [LAMBDA RECEIVER] return lambda.invoke(receiver) +19 (INLINE CALL inlineF) [LAMBDA RECEIVER] inline fun inlineF(receiver: String, lambda: String.() -> String): String { +8 [LAMBDA RECEIVER] val v3 = inlineF(p, { this }) 8 val v3 = inlineF(p, { this }) 8 val v3 = inlineF(p, { this }) 8 [LAMBDA CALLS] val v3 = inlineF(p, { this }) diff --git a/idea/testData/slicer/outflow/invokeExtensionLambda2.results.txt b/idea/testData/slicer/outflow/invokeExtensionLambda2.results.txt index 578610aa85d0a..e1b958860b17e 100644 --- a/idea/testData/slicer/outflow/invokeExtensionLambda2.results.txt +++ b/idea/testData/slicer/outflow/invokeExtensionLambda2.results.txt @@ -2,12 +2,12 @@ 4 val v1 = bar(p) { { this } } 7 (INLINE CALL bar) inline fun bar(x: String, lambda: () -> String.() -> String): String { 8 (INLINE CALL bar) return lambda()(x) -8 (INLINE CALL bar) [LAMBDA RECEIVER IN] return lambda()(x) -8 (INLINE CALL bar) [LAMBDA IN] [LAMBDA RECEIVER IN] return lambda()(x) -7 (INLINE CALL bar) [LAMBDA IN] [LAMBDA RECEIVER IN] inline fun bar(x: String, lambda: () -> String.() -> String): String { -4 [LAMBDA IN] [LAMBDA RECEIVER IN] val v1 = bar(p) { { this } } -4 [LAMBDA RECEIVER IN] val v1 = bar(p) { { this } } -4 [LAMBDA RECEIVER IN] val v1 = bar(p) { { this } } +8 (INLINE CALL bar) [LAMBDA RECEIVER] return lambda()(x) +8 (INLINE CALL bar) [LAMBDA IN] [LAMBDA RECEIVER] return lambda()(x) +7 (INLINE CALL bar) [LAMBDA IN] [LAMBDA RECEIVER] inline fun bar(x: String, lambda: () -> String.() -> String): String { +4 [LAMBDA IN] [LAMBDA RECEIVER] val v1 = bar(p) { { this } } +4 [LAMBDA RECEIVER] val v1 = bar(p) { { this } } +4 [LAMBDA RECEIVER] val v1 = bar(p) { { this } } 4 val v1 = bar(p) { { this } } 4 val v1 = bar(p) { { this } } 4 [LAMBDA CALLS] val v1 = bar(p) { { this } } diff --git a/idea/testData/slicer/outflow/invokeExtensionLambda3.results.txt b/idea/testData/slicer/outflow/invokeExtensionLambda3.results.txt index 95ea185ff143a..9c16a2f114f5f 100644 --- a/idea/testData/slicer/outflow/invokeExtensionLambda3.results.txt +++ b/idea/testData/slicer/outflow/invokeExtensionLambda3.results.txt @@ -2,10 +2,10 @@ 4 val v = bar(p) { this } 7 fun bar(receiver: T, block: T.() -> R): R { 9 return receiver.b() -8 [LAMBDA RECEIVER IN] val b = block -8 [LAMBDA RECEIVER IN] val b = block -7 [LAMBDA RECEIVER IN] fun bar(receiver: T, block: T.() -> R): R { -4 [LAMBDA RECEIVER IN] val v = bar(p) { this } +8 [LAMBDA RECEIVER] val b = block +8 [LAMBDA RECEIVER] val b = block +7 [LAMBDA RECEIVER] fun bar(receiver: T, block: T.() -> R): R { +4 [LAMBDA RECEIVER] val v = bar(p) { this } 4 val v = bar(p) { this } 4 val v = bar(p) { this } 4 [LAMBDA CALLS] val v = bar(p) { this } diff --git a/idea/testData/slicer/outflow/invokeLambdaSecondParam.results.txt b/idea/testData/slicer/outflow/invokeLambdaSecondParam.results.txt index d5be4c76ed6c9..b685ffa2c3657 100644 --- a/idea/testData/slicer/outflow/invokeLambdaSecondParam.results.txt +++ b/idea/testData/slicer/outflow/invokeLambdaSecondParam.results.txt @@ -2,8 +2,8 @@ 4 val v = f({ p1, p2 -> p2 }, p) 7 fun f(lambda: (String, String) -> String, receiver: String): String { 8 return lambda("a", receiver) -7 [LAMBDA ARGUMENT IN] fun f(lambda: (String, String) -> String, receiver: String): String { -4 [LAMBDA ARGUMENT IN] val v = f({ p1, p2 -> p2 }, p) +7 [LAMBDA PARAMETER #1] fun f(lambda: (String, String) -> String, receiver: String): String { +4 [LAMBDA PARAMETER #1] val v = f({ p1, p2 -> p2 }, p) 4 val v = f({ p1, p2 -> p2 }, p) 4 val v = f({ p1, p2 -> p2 }, p) 4 val v = f({ p1, p2 -> p2 }, p) diff --git a/idea/testData/slicer/outflow/letResult.results.txt b/idea/testData/slicer/outflow/letResult.results.txt index 8494a2a592938..e86e5011aacfc 100644 --- a/idea/testData/slicer/outflow/letResult.results.txt +++ b/idea/testData/slicer/outflow/letResult.results.txt @@ -2,8 +2,8 @@ 4 val v1 = p.let { value -> bar(value) } 19 (INLINE CALL let) inline fun T.let(block: (T) -> R): R { 20 (INLINE CALL let) return block(this) -19 (INLINE CALL let) [LAMBDA ARGUMENT IN] inline fun T.let(block: (T) -> R): R { -4 [LAMBDA ARGUMENT IN] val v1 = p.let { value -> bar(value) } +19 (INLINE CALL let) [LAMBDA PARAMETER #0] inline fun T.let(block: (T) -> R): R { +4 [LAMBDA PARAMETER #0] val v1 = p.let { value -> bar(value) } 4 val v1 = p.let { value -> bar(value) } 4 val v1 = p.let { value -> bar(value) } 16 fun bar(s: String) = s @@ -19,8 +19,8 @@ 6 val v2 = p.let { it } 19 (INLINE CALL let) inline fun T.let(block: (T) -> R): R { 20 (INLINE CALL let) return block(this) -19 (INLINE CALL let) [LAMBDA ARGUMENT IN] inline fun T.let(block: (T) -> R): R { -6 [LAMBDA ARGUMENT IN] val v2 = p.let { it } +19 (INLINE CALL let) [LAMBDA PARAMETER #0] inline fun T.let(block: (T) -> R): R { +6 [LAMBDA PARAMETER #0] val v2 = p.let { it } 6 val v2 = p.let { it } 6 val v2 = p.let { it } 6 [LAMBDA CALLS] val v2 = p.let { it } @@ -31,13 +31,13 @@ 8 val v3 = p.let { 19 (INLINE CALL let) inline fun T.let(block: (T) -> R): R { 20 (INLINE CALL let) return block(this) -19 (INLINE CALL let) [LAMBDA ARGUMENT IN] inline fun T.let(block: (T) -> R): R { -8 [LAMBDA ARGUMENT IN] val v3 = p.let { +19 (INLINE CALL let) [LAMBDA PARAMETER #0] inline fun T.let(block: (T) -> R): R { +8 [LAMBDA PARAMETER #0] val v3 = p.let { 13 val v4 = p.let(::zoo) 19 (INLINE CALL let) inline fun T.let(block: (T) -> R): R { 20 (INLINE CALL let) return block(this) -19 (INLINE CALL let) [LAMBDA ARGUMENT IN] inline fun T.let(block: (T) -> R): R { -13 [LAMBDA ARGUMENT IN] val v4 = p.let(::zoo) +19 (INLINE CALL let) [LAMBDA PARAMETER #0] inline fun T.let(block: (T) -> R): R { +13 [LAMBDA PARAMETER #0] val v4 = p.let(::zoo) 17 fun zoo(s: String) = s 17 fun zoo(s: String) = s 17 fun zoo(s: String) = s diff --git a/idea/testData/slicer/outflow/nonInlineLetResult.results.txt b/idea/testData/slicer/outflow/nonInlineLetResult.results.txt index a6edbba90f650..a0f70e405fac4 100644 --- a/idea/testData/slicer/outflow/nonInlineLetResult.results.txt +++ b/idea/testData/slicer/outflow/nonInlineLetResult.results.txt @@ -2,8 +2,8 @@ 4 val v1 = p.let { value -> bar(value) } 16 fun T.let(block: (T) -> R): R { 17 return block(this) -16 [LAMBDA ARGUMENT IN] fun T.let(block: (T) -> R): R { -4 [LAMBDA ARGUMENT IN] val v1 = p.let { value -> bar(value) } +16 [LAMBDA PARAMETER #0] fun T.let(block: (T) -> R): R { +4 [LAMBDA PARAMETER #0] val v1 = p.let { value -> bar(value) } 4 val v1 = p.let { value -> bar(value) } 4 val v1 = p.let { value -> bar(value) } 14 fun bar(s: String) = s @@ -21,12 +21,12 @@ 6 val v2 = p.let { it } 8 val v3 = p.let { 8 val v3 = p.let { -6 [LAMBDA ARGUMENT IN] val v2 = p.let { it } +6 [LAMBDA PARAMETER #0] val v2 = p.let { it } 6 val v2 = p.let { it } 6 val v2 = p.let { it } 6 [LAMBDA CALLS] val v2 = p.let { it } 16 [LAMBDA CALLS] DUPLICATE: fun T.let(block: (T) -> R): R { -8 [LAMBDA ARGUMENT IN] val v3 = p.let { +8 [LAMBDA PARAMETER #0] val v3 = p.let { 6 val v2 = p.let { it } 16 DUPLICATE: fun T.let(block: (T) -> R): R { 8 val v3 = p.let { diff --git a/idea/testData/slicer/outflow/nullableLambda.results.txt b/idea/testData/slicer/outflow/nullableLambda.results.txt index db685ff980206..ac54c9bf2f5e4 100644 --- a/idea/testData/slicer/outflow/nullableLambda.results.txt +++ b/idea/testData/slicer/outflow/nullableLambda.results.txt @@ -2,10 +2,10 @@ 4 val v = bar(p, true, { this }) 7 fun bar(receiver: String, b: Boolean, lambda: (String.() -> String)?): String { 8 return if (b) lambda!!.invoke(receiver) else "" -8 [LAMBDA RECEIVER IN] return if (b) lambda!!.invoke(receiver) else "" -8 [LAMBDA RECEIVER IN] return if (b) lambda!!.invoke(receiver) else "" -7 [LAMBDA RECEIVER IN] fun bar(receiver: String, b: Boolean, lambda: (String.() -> String)?): String { -4 [LAMBDA RECEIVER IN] val v = bar(p, true, { this }) +8 [LAMBDA RECEIVER] return if (b) lambda!!.invoke(receiver) else "" +8 [LAMBDA RECEIVER] return if (b) lambda!!.invoke(receiver) else "" +7 [LAMBDA RECEIVER] fun bar(receiver: String, b: Boolean, lambda: (String.() -> String)?): String { +4 [LAMBDA RECEIVER] val v = bar(p, true, { this }) 4 val v = bar(p, true, { this }) 4 val v = bar(p, true, { this }) 4 [LAMBDA CALLS] val v = bar(p, true, { this }) diff --git a/idea/testData/slicer/outflow/withResult.results.txt b/idea/testData/slicer/outflow/withResult.results.txt index 002a6421182e9..62dcdd0d090a5 100644 --- a/idea/testData/slicer/outflow/withResult.results.txt +++ b/idea/testData/slicer/outflow/withResult.results.txt @@ -2,8 +2,8 @@ 4 val v1 = with(p) { this } 16 (INLINE CALL with) inline fun with(receiver: T, block: T.() -> R): R { 17 (INLINE CALL with) return receiver.block() -16 (INLINE CALL with) [LAMBDA RECEIVER IN] inline fun with(receiver: T, block: T.() -> R): R { -4 [LAMBDA RECEIVER IN] val v1 = with(p) { this } +16 (INLINE CALL with) [LAMBDA RECEIVER] inline fun with(receiver: T, block: T.() -> R): R { +4 [LAMBDA RECEIVER] val v1 = with(p) { this } 4 val v1 = with(p) { this } 4 val v1 = with(p) { this } 4 [LAMBDA CALLS] val v1 = with(p) { this } @@ -14,8 +14,8 @@ 6 val v2 = with(p) { bar(this) } 16 (INLINE CALL with) inline fun with(receiver: T, block: T.() -> R): R { 17 (INLINE CALL with) return receiver.block() -16 (INLINE CALL with) [LAMBDA RECEIVER IN] inline fun with(receiver: T, block: T.() -> R): R { -6 [LAMBDA RECEIVER IN] val v2 = with(p) { bar(this) } +16 (INLINE CALL with) [LAMBDA RECEIVER] inline fun with(receiver: T, block: T.() -> R): R { +6 [LAMBDA RECEIVER] val v2 = with(p) { bar(this) } 6 val v2 = with(p) { bar(this) } 13 fun bar(s: String) = s 13 fun bar(s: String) = s @@ -30,13 +30,13 @@ 8 val v3 = with(p) { this@foo } 16 (INLINE CALL with) inline fun with(receiver: T, block: T.() -> R): R { 17 (INLINE CALL with) return receiver.block() -16 (INLINE CALL with) [LAMBDA RECEIVER IN] inline fun with(receiver: T, block: T.() -> R): R { -8 [LAMBDA RECEIVER IN] val v3 = with(p) { this@foo } +16 (INLINE CALL with) [LAMBDA RECEIVER] inline fun with(receiver: T, block: T.() -> R): R { +8 [LAMBDA RECEIVER] val v3 = with(p) { this@foo } 10 val v4 = with(p, ::zoo) 16 (INLINE CALL with) inline fun with(receiver: T, block: T.() -> R): R { 17 (INLINE CALL with) return receiver.block() -16 (INLINE CALL with) [LAMBDA RECEIVER IN] inline fun with(receiver: T, block: T.() -> R): R { -10 [LAMBDA RECEIVER IN] val v4 = with(p, ::zoo) +16 (INLINE CALL with) [LAMBDA RECEIVER] inline fun with(receiver: T, block: T.() -> R): R { +10 [LAMBDA RECEIVER] val v4 = with(p, ::zoo) 14 fun zoo(s: String) = s 14 fun zoo(s: String) = s 14 fun zoo(s: String) = s