Skip to content

Commit

Permalink
Merged LambdaResultOutflowBehaviour and LambdaCallsBehaviour into one
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinkip committed Apr 17, 2020
1 parent 1e39d4a commit 61d4383
Show file tree
Hide file tree
Showing 48 changed files with 242 additions and 254 deletions.
31 changes: 0 additions & 31 deletions idea/src/org/jetbrains/kotlin/idea/slicer/KotlinSliceUsage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import com.intellij.psi.PsiElement
import com.intellij.slicer.SliceAnalysisParams
import com.intellij.slicer.SliceUsage
import com.intellij.usageView.UsageInfo
import org.jetbrains.kotlin.idea.KotlinBundle
import org.jetbrains.kotlin.idea.findUsages.handlers.SliceUsageProcessor
import org.jetbrains.kotlin.psi.KtElement

Expand Down Expand Up @@ -100,33 +99,3 @@ open class KotlinSliceUsage : SliceUsage {
}
}

data class LambdaResultOutflowBehaviour(
override val originalBehaviour: KotlinSliceUsage.SpecialBehaviour?
) : KotlinSliceUsage.SpecialBehaviour {

override fun processUsages(element: KtElement, parent: KotlinSliceUsage, uniqueProcessor: SliceUsageProcessor) {
OutflowSlicer(element, uniqueProcessor, parent).processChildren(parent.forcedExpressionMode)
}

override val slicePresentationPrefix: String
get() = KotlinBundle.message("slicer.text.tracking.enclosing.lambda")

override val testPresentationPrefix: String
get() = "[LAMBDA] "
}

data class LambdaResultInflowBehaviour(
override val originalBehaviour: KotlinSliceUsage.SpecialBehaviour?
) : KotlinSliceUsage.SpecialBehaviour {

override fun processUsages(element: KtElement, parent: KotlinSliceUsage, uniqueProcessor: SliceUsageProcessor) {
InflowSlicer(element, uniqueProcessor, parent).processChildren(parent.forcedExpressionMode)
}

override val slicePresentationPrefix: String
get() = KotlinBundle.message("slicer.text.tracking.enclosing.lambda")

override val testPresentationPrefix: String
get() = "[LAMBDA] "
}

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ data class LambdaCallsBehaviour(
val sliceElement = sliceUsage.element ?: return true
val resolvedCall = (sliceElement as? KtElement)?.resolveToCall()
if (resolvedCall?.call?.callType == Call.CallType.INVOKE) {
return sliceProducer.produceAndProcess(sliceUsage, originalBehaviour, parent, uniqueProcessor)
val newSliceUsage = KotlinSliceUsage(resolvedCall.call.callElement, parent, originalBehaviour, true)
return sliceProducer.produceAndProcess(newSliceUsage, originalBehaviour, parent, uniqueProcessor)
}
}
return uniqueProcessor.process(sliceUsage)
Expand All @@ -37,5 +38,5 @@ data class LambdaCallsBehaviour(
get() = KotlinBundle.message("slicer.text.tracking.lambda.calls")

override val testPresentationPrefix: String
get() = "[LAMBDA CALLS] "
get() = "[LAMBDA OUT] "
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2010-2020 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.idea.slicer

import org.jetbrains.kotlin.idea.KotlinBundle
import org.jetbrains.kotlin.idea.findUsages.handlers.SliceUsageProcessor
import org.jetbrains.kotlin.psi.KtElement

data class LambdaResultInflowBehaviour(
override val originalBehaviour: KotlinSliceUsage.SpecialBehaviour?
) : KotlinSliceUsage.SpecialBehaviour {

override fun processUsages(element: KtElement, parent: KotlinSliceUsage, uniqueProcessor: SliceUsageProcessor) {
InflowSlicer(element, uniqueProcessor, parent).processChildren(parent.forcedExpressionMode)
}

override val slicePresentationPrefix: String
get() = KotlinBundle.message("slicer.text.tracking.enclosing.lambda")

override val testPresentationPrefix: String
get() = "[LAMBDA IN] "
}
13 changes: 4 additions & 9 deletions idea/src/org/jetbrains/kotlin/idea/slicer/OutflowSlicer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class OutflowSlicer(
is KtNamedFunction -> function
else -> null
} ?: return
funExpression.passToProcessor(LambdaResultOutflowBehaviour(behaviour), forcedExpressionMode = true)
funExpression.passToProcessor(LambdaCallsBehaviour(SliceProducer.Trivial, behaviour), forcedExpressionMode = true)
}

private fun processExtensionReceiver(declaration: KtCallableDeclaration, declarationWithBody: KtDeclarationWithBody) {
Expand Down Expand Up @@ -223,13 +223,8 @@ class OutflowSlicer(
}

Call.CallType.INVOKE -> {
if (receiverValue == resolvedCall.dispatchReceiver) {
if (behaviour is LambdaResultOutflowBehaviour) {
instruction.element.passToProcessor(behaviour.originalBehaviour)
}
else if (behaviour is LambdaCallsBehaviour) {
instruction.element.passToProcessor(behaviour)
}
if (receiverValue == resolvedCall.dispatchReceiver && behaviour is LambdaCallsBehaviour) {
instruction.element.passToProcessor(behaviour)
}
}

Expand Down Expand Up @@ -291,7 +286,7 @@ class OutflowSlicer(
refElement.getCallElementForExactCallee()
?.let { this += KotlinSliceUsage(it, parent, behaviour, false) }
refElement.getCallableReferenceForExactCallee()
?.let { this += KotlinSliceUsage(it, parent, LambdaResultOutflowBehaviour(behaviour), false) }
?.let { this += KotlinSliceUsage(it, parent, LambdaCallsBehaviour(SliceProducer.Trivial, behaviour), false) }
}
}

Expand Down
9 changes: 9 additions & 0 deletions idea/src/org/jetbrains/kotlin/idea/slicer/SliceProducer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ interface SliceProducer {

override fun equals(other: Any?): Boolean
override fun hashCode(): Int

object Trivial : SliceProducer {
override fun produce(usage: UsageInfo, behaviour: KotlinSliceUsage.SpecialBehaviour?, parent: SliceUsage): Collection<SliceUsage>? {
return null
}

override fun equals(other: Any?) = other === this
override fun hashCode() = 0
}
}

fun SliceProducer.produceAndProcess(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
8 val x = <bold>foo(fun(n: Int) = n)</bold>
3 fun <bold>foo(f: (Int) -> Int): Int {</bold>
4 return <bold>f(1)</bold>
4 [LAMBDA] return <bold>f</bold>(1)
3 [LAMBDA] fun foo(<bold>f: (Int) -> Int</bold>): Int {
8 [LAMBDA] val x = foo(<bold>fun(n: Int) = n</bold>)
4 [LAMBDA IN] return <bold>f</bold>(1)
3 [LAMBDA IN] fun foo(<bold>f: (Int) -> Int</bold>): Int {
8 [LAMBDA IN] val x = foo(<bold>fun(n: Int) = n</bold>)
8 val x = foo(<bold>fun(n: Int) = n</bold>)
8 val x = foo(fun(n: Int) = <bold>n</bold>)
8 val x = foo(fun(<bold>n: Int</bold>) = n)
8 [LAMBDA CALLS] val x = foo(<bold>fun(n: Int) = n</bold>)
3 [LAMBDA CALLS] fun foo(<bold>f: (Int) -> Int</bold>): Int {
8 [LAMBDA OUT] val x = foo(<bold>fun(n: Int) = n</bold>)
3 [LAMBDA OUT] fun foo(<bold>f: (Int) -> Int</bold>): Int {
4 return f(<bold>1</bold>)

Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
8 val x = <bold>foo(fun(n: Int) = n)</bold>
3 fun <bold>foo(f: (Int) -> Int): Int {</bold>
4 return <bold>f(1)</bold>
4 [LAMBDA] return <bold>f</bold>(1)
3 [LAMBDA] fun foo(<bold>f: (Int) -> Int</bold>): Int {
8 [LAMBDA] val x = foo(<bold>fun(n: Int) = n</bold>)
4 [LAMBDA IN] return <bold>f</bold>(1)
3 [LAMBDA IN] fun foo(<bold>f: (Int) -> Int</bold>): Int {
8 [LAMBDA IN] val x = foo(<bold>fun(n: Int) = n</bold>)
8 val x = foo(<bold>fun(n: Int) = n</bold>)
8 val x = foo(fun(n: Int) = <bold>n</bold>)
8 val x = foo(fun(<bold>n: Int</bold>) = n)
8 [LAMBDA CALLS] val x = foo(<bold>fun(n: Int) = n</bold>)
3 [LAMBDA CALLS] fun foo(<bold>f: (Int) -> Int</bold>): Int {
8 [LAMBDA OUT] val x = foo(<bold>fun(n: Int) = n</bold>)
3 [LAMBDA OUT] fun foo(<bold>f: (Int) -> Int</bold>): Int {
4 return f(<bold>1</bold>)
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
8 val x = <bold>foo(fun(n: Int): Int { return n })</bold>
3 fun <bold>foo(f: (Int) -> Int): Int {</bold>
4 return <bold>f(1)</bold>
4 [LAMBDA] return <bold>f</bold>(1)
3 [LAMBDA] fun foo(<bold>f: (Int) -> Int</bold>): Int {
8 [LAMBDA] val x = foo(<bold>fun(n: Int): Int { return n }</bold>)
4 [LAMBDA IN] return <bold>f</bold>(1)
3 [LAMBDA IN] fun foo(<bold>f: (Int) -> Int</bold>): Int {
8 [LAMBDA IN] val x = foo(<bold>fun(n: Int): Int { return n }</bold>)
8 val x = foo(<bold>fun(n: Int): Int { return n }</bold>)
8 val x = foo(fun(n: Int): Int { return <bold>n</bold> })
8 val x = foo(fun(<bold>n: Int</bold>): Int { return n })
8 [LAMBDA CALLS] val x = foo(<bold>fun(n: Int): Int { return n }</bold>)
3 [LAMBDA CALLS] fun foo(<bold>f: (Int) -> Int</bold>): Int {
8 [LAMBDA OUT] val x = foo(<bold>fun(n: Int): Int { return n }</bold>)
3 [LAMBDA OUT] fun foo(<bold>f: (Int) -> Int</bold>): Int {
4 return f(<bold>1</bold>)

Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
8 val x = <bold>foo(fun(n: Int): Int { return n })</bold>
3 fun <bold>foo(f: (Int) -> Int): Int {</bold>
4 return <bold>f(1)</bold>
4 [LAMBDA] return <bold>f</bold>(1)
3 [LAMBDA] fun foo(<bold>f: (Int) -> Int</bold>): Int {
8 [LAMBDA] val x = foo(<bold>fun(n: Int): Int { return n }</bold>)
4 [LAMBDA IN] return <bold>f</bold>(1)
3 [LAMBDA IN] fun foo(<bold>f: (Int) -> Int</bold>): Int {
8 [LAMBDA IN] val x = foo(<bold>fun(n: Int): Int { return n }</bold>)
8 val x = foo(<bold>fun(n: Int): Int { return n }</bold>)
8 val x = foo(fun(n: Int): Int { return <bold>n</bold> })
8 val x = foo(fun(<bold>n: Int</bold>): Int { return n })
8 [LAMBDA CALLS] val x = foo(<bold>fun(n: Int): Int { return n }</bold>)
3 [LAMBDA CALLS] fun foo(<bold>f: (Int) -> Int</bold>): Int {
8 [LAMBDA OUT] val x = foo(<bold>fun(n: Int): Int { return n }</bold>)
3 [LAMBDA OUT] fun foo(<bold>f: (Int) -> Int</bold>): Int {
4 return f(<bold>1</bold>)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
9 val <bold>v = value</bold>
9 val v = <bold>value</bold>
8 foo(fun(<bold>value: Int</bold>) {
8 [LAMBDA CALLS] foo(<bold>fun(value: Int) {</bold>
3 [LAMBDA CALLS] fun foo(<bold>f: (Int) -> Unit</bold>) {
8 [LAMBDA OUT] foo(<bold>fun(value: Int) {</bold>
3 [LAMBDA OUT] fun foo(<bold>f: (Int) -> Unit</bold>) {
4 f(<bold>1</bold>)

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
9 val <bold>v = value</bold>
9 val v = <bold>value</bold>
8 foo(fun(<bold>value: Int</bold>) {
8 [LAMBDA CALLS] foo(<bold>fun(value: Int) {</bold>
3 [LAMBDA CALLS] fun foo(<bold>f: (Int) -> Unit</bold>) {
8 [LAMBDA OUT] foo(<bold>fun(value: Int) {</bold>
3 [LAMBDA OUT] fun foo(<bold>f: (Int) -> Unit</bold>) {
4 f(<bold>1</bold>)
29 changes: 14 additions & 15 deletions idea/testData/slicer/inflow/doubleLambdaResult.leafGroups.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@
8 val x = <bold>foo(1, 2) { { it } }</bold>
3 fun <bold>foo(a: Int, b: Int, f: (Int) -> (Int) -> Int): Int {</bold>
4 return <bold>f(a)(b)</bold>
4 [LAMBDA] return <bold>f(a)</bold>(b)
4 [LAMBDA] [LAMBDA] return <bold>f</bold>(a)(b)
3 [LAMBDA] [LAMBDA] fun foo(a: Int, b: Int, <bold>f: (Int) -> (Int) -> Int</bold>): Int {
8 [LAMBDA] [LAMBDA] val x = foo(1, 2) <bold>{ { it } }</bold>
8 [LAMBDA] val x = foo(1, 2) <bold>{ { it } }</bold>
8 [LAMBDA] val x = foo(1, 2) { <bold>{ it }</bold> }
4 [LAMBDA IN] return <bold>f(a)</bold>(b)
4 [LAMBDA IN] [LAMBDA IN] return <bold>f</bold>(a)(b)
3 [LAMBDA IN] [LAMBDA IN] fun foo(a: Int, b: Int, <bold>f: (Int) -> (Int) -> Int</bold>): Int {
8 [LAMBDA IN] [LAMBDA IN] val x = foo(1, 2) <bold>{ { it } }</bold>
8 [LAMBDA IN] val x = foo(1, 2) <bold>{ { it } }</bold>
8 [LAMBDA IN] val x = foo(1, 2) { <bold>{ it }</bold> }
8 val x = foo(1, 2) { <bold>{ it }</bold> }
8 val x = foo(1, 2) { { <bold>it</bold> } }
8 [LAMBDA CALLS] val x = foo(1, 2) { <bold>{ it }</bold> }
8 [LAMBDA CALLS] val x = foo(1, 2) <bold>{ { it } }</bold>
8 [LAMBDA] [LAMBDA CALLS] val x = foo(1, 2) <bold>{ { it } }</bold>
3 [LAMBDA] [LAMBDA CALLS] fun foo(a: Int, b: Int, <bold>f: (Int) -> (Int) -> Int</bold>): Int {
4 [LAMBDA] [LAMBDA CALLS] return <bold>f</bold>(a)(b)
4 [LAMBDA CALLS] return <bold>f(a)</bold>(b)
4 return f(a)(<bold>b</bold>)
3 fun foo(a: Int, <bold>b: Int</bold>, f: (Int) -> (Int) -> Int): Int {
8 val x = foo(1, <bold>2</bold>) { { it } }
8 [LAMBDA OUT] val x = foo(1, 2) { <bold>{ it }</bold> }
8 [LAMBDA OUT] val x = foo(1, 2) <bold>{ { it } }</bold>
8 [LAMBDA OUT] [LAMBDA OUT] val x = foo(1, 2) <bold>{ { it } }</bold>
3 [LAMBDA OUT] [LAMBDA OUT] fun foo(a: Int, b: Int, <bold>f: (Int) -> (Int) -> Int</bold>): Int {
4 [LAMBDA OUT] return <bold>f(a)</bold>(b)
4 return f(a)(<bold>b</bold>)
3 fun foo(a: Int, <bold>b: Int</bold>, f: (Int) -> (Int) -> Int): Int {
8 val x = foo(1, <bold>2</bold>) { { it } }

29 changes: 14 additions & 15 deletions idea/testData/slicer/inflow/doubleLambdaResult.results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@
8 val x = <bold>foo(1, 2) { { it } }</bold>
3 fun <bold>foo(a: Int, b: Int, f: (Int) -> (Int) -> Int): Int {</bold>
4 return <bold>f(a)(b)</bold>
4 [LAMBDA] return <bold>f(a)</bold>(b)
4 [LAMBDA] [LAMBDA] return <bold>f</bold>(a)(b)
3 [LAMBDA] [LAMBDA] fun foo(a: Int, b: Int, <bold>f: (Int) -> (Int) -> Int</bold>): Int {
8 [LAMBDA] [LAMBDA] val x = foo(1, 2) <bold>{ { it } }</bold>
8 [LAMBDA] val x = foo(1, 2) <bold>{ { it } }</bold>
8 [LAMBDA] val x = foo(1, 2) { <bold>{ it }</bold> }
4 [LAMBDA IN] return <bold>f(a)</bold>(b)
4 [LAMBDA IN] [LAMBDA IN] return <bold>f</bold>(a)(b)
3 [LAMBDA IN] [LAMBDA IN] fun foo(a: Int, b: Int, <bold>f: (Int) -> (Int) -> Int</bold>): Int {
8 [LAMBDA IN] [LAMBDA IN] val x = foo(1, 2) <bold>{ { it } }</bold>
8 [LAMBDA IN] val x = foo(1, 2) <bold>{ { it } }</bold>
8 [LAMBDA IN] val x = foo(1, 2) { <bold>{ it }</bold> }
8 val x = foo(1, 2) { <bold>{ it }</bold> }
8 val x = foo(1, 2) { { <bold>it</bold> } }
8 [LAMBDA CALLS] val x = foo(1, 2) { <bold>{ it }</bold> }
8 [LAMBDA CALLS] val x = foo(1, 2) <bold>{ { it } }</bold>
8 [LAMBDA] [LAMBDA CALLS] val x = foo(1, 2) <bold>{ { it } }</bold>
3 [LAMBDA] [LAMBDA CALLS] fun foo(a: Int, b: Int, <bold>f: (Int) -> (Int) -> Int</bold>): Int {
4 [LAMBDA] [LAMBDA CALLS] return <bold>f</bold>(a)(b)
4 [LAMBDA CALLS] return <bold>f(a)</bold>(b)
4 return f(a)(<bold>b</bold>)
3 fun foo(a: Int, <bold>b: Int</bold>, f: (Int) -> (Int) -> Int): Int {
8 val x = foo(1, <bold>2</bold>) { { it } }
8 [LAMBDA OUT] val x = foo(1, 2) { <bold>{ it }</bold> }
8 [LAMBDA OUT] val x = foo(1, 2) <bold>{ { it } }</bold>
8 [LAMBDA OUT] [LAMBDA OUT] val x = foo(1, 2) <bold>{ { it } }</bold>
3 [LAMBDA OUT] [LAMBDA OUT] fun foo(a: Int, b: Int, <bold>f: (Int) -> (Int) -> Int</bold>): Int {
4 [LAMBDA OUT] return <bold>f(a)</bold>(b)
4 return f(a)(<bold>b</bold>)
3 fun foo(a: Int, <bold>b: Int</bold>, f: (Int) -> (Int) -> Int): Int {
8 val x = foo(1, <bold>2</bold>) { { it } }
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
4 f("", <bold>1</bold>)
15 val v = <bold>it</bold>
14 [LAMBDA CALLS] foo <bold>{</bold>
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
14 [LAMBDA OUT] foo <bold>{</bold>
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
4 f("", <bold>1</bold>)

6 "".f(<bold>2</bold>)
15 val v = <bold>it</bold>
14 [LAMBDA CALLS] foo <bold>{</bold>
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
14 [LAMBDA OUT] foo <bold>{</bold>
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
6 "".f(<bold>2</bold>)

9 f(<bold>3</bold>)
15 val v = <bold>it</bold>
14 [LAMBDA CALLS] foo <bold>{</bold>
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
14 [LAMBDA OUT] foo <bold>{</bold>
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
9 f(<bold>3</bold>)

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
15 val v = <bold>it</bold>
14 [LAMBDA CALLS] foo <bold>{</bold>
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
14 [LAMBDA OUT] foo <bold>{</bold>
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
4 f("", <bold>1</bold>)
6 "".f(<bold>2</bold>)
9 f(<bold>3</bold>)
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
4 f("", <bold>1</bold>)
15 val v = <bold>i</bold>
14 foo { <bold>i</bold> ->
14 [LAMBDA CALLS] foo <bold>{ i -></bold>
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
14 [LAMBDA OUT] foo <bold>{ i -></bold>
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
4 f("", <bold>1</bold>)

6 "".f(<bold>2</bold>)
15 val v = <bold>i</bold>
14 foo { <bold>i</bold> ->
14 [LAMBDA CALLS] foo <bold>{ i -></bold>
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
14 [LAMBDA OUT] foo <bold>{ i -></bold>
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
6 "".f(<bold>2</bold>)

9 f(<bold>3</bold>)
15 val v = <bold>i</bold>
14 foo { <bold>i</bold> ->
14 [LAMBDA CALLS] foo <bold>{ i -></bold>
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
14 [LAMBDA OUT] foo <bold>{ i -></bold>
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
9 f(<bold>3</bold>)

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
15 val v = <bold>i</bold>
14 foo { <bold>i</bold> ->
14 [LAMBDA CALLS] foo <bold>{ i -></bold>
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
14 [LAMBDA OUT] foo <bold>{ i -></bold>
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) {
4 f("", <bold>1</bold>)
6 "".f(<bold>2</bold>)
9 f(<bold>3</bold>)
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
9 val x = <bold>foo(::bar)</bold>
3 fun <bold>foo(f: (Int) -> Int): Int {</bold>
4 return <bold>f(1)</bold>
4 [LAMBDA] return <bold>f</bold>(1)
3 [LAMBDA] fun foo(<bold>f: (Int) -> Int</bold>): Int {
9 [LAMBDA] val x = foo(<bold>::bar</bold>)
4 [LAMBDA IN] return <bold>f</bold>(1)
3 [LAMBDA IN] fun foo(<bold>f: (Int) -> Int</bold>): Int {
9 [LAMBDA IN] val x = foo(<bold>::bar</bold>)
8 fun <bold>bar(n: Int) = n</bold>
8 fun bar(n: Int) = <bold>n</bold>
8 fun bar(<bold>n: Int</bold>) = n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
9 val x = <bold>foo(::bar)</bold>
3 fun <bold>foo(f: (Int) -> Int): Int {</bold>
4 return <bold>f(1)</bold>
4 [LAMBDA] return <bold>f</bold>(1)
3 [LAMBDA] fun foo(<bold>f: (Int) -> Int</bold>): Int {
9 [LAMBDA] val x = foo(<bold>::bar</bold>)
4 [LAMBDA IN] return <bold>f</bold>(1)
3 [LAMBDA IN] fun foo(<bold>f: (Int) -> Int</bold>): Int {
9 [LAMBDA IN] val x = foo(<bold>::bar</bold>)
8 fun <bold>bar(n: Int) = n</bold>
8 fun bar(n: Int) = <bold>n</bold>
8 fun bar(<bold>n: Int</bold>) = n

0 comments on commit 61d4383

Please sign in to comment.