diff --git a/idea/testData/slicer/inflow/defaultGetterFieldInSetter.kt b/idea/testData/slicer/inflow/defaultGetterFieldInSetter.kt index 66ee8f8902c..1e1202f7848 100644 --- a/idea/testData/slicer/inflow/defaultGetterFieldInSetter.kt +++ b/idea/testData/slicer/inflow/defaultGetterFieldInSetter.kt @@ -1,7 +1,7 @@ // FLOW: IN class A(var b: Boolean) { - var foo: Int + var foo: Int = 0 set(value) { field = if (b) value else 0 } diff --git a/idea/testData/slicer/inflow/defaultGetterFieldInSetter.leafGroups.txt b/idea/testData/slicer/inflow/defaultGetterFieldInSetter.leafGroups.txt index 7dc418989a4..02c1e9edfed 100644 --- a/idea/testData/slicer/inflow/defaultGetterFieldInSetter.leafGroups.txt +++ b/idea/testData/slicer/inflow/defaultGetterFieldInSetter.leafGroups.txt @@ -1,12 +1,11 @@ -6 field = if (b) value else 0 +4 var foo: Int = 0 10 val x = foo -4 var foo: Int -6 field = if (b) value else 0 -6 field = if (b) value else 0 +4 var foo: Int = 0 +4 var foo: Int = 0 11 foo = 1 10 val x = foo -4 var foo: Int +4 var foo: Int = 0 6 field = if (b) value else 0 6 field = if (b) value else 0 5 set(value) { diff --git a/idea/testData/slicer/inflow/defaultGetterFieldInSetter.results.txt b/idea/testData/slicer/inflow/defaultGetterFieldInSetter.results.txt index 481509af331..2f668737f6e 100644 --- a/idea/testData/slicer/inflow/defaultGetterFieldInSetter.results.txt +++ b/idea/testData/slicer/inflow/defaultGetterFieldInSetter.results.txt @@ -1,5 +1,6 @@ 10 val x = foo -4 var foo: Int +4 var foo: Int = 0 +4 var foo: Int = 0 6 field = if (b) value else 0 6 field = if (b) value else 0 5 set(value) { diff --git a/idea/testData/slicer/inflow/delegateToJavaGetter.java b/idea/testData/slicer/inflow/delegateToJavaGetter.java index 16136c4c0bc..3e7da6b4392 100644 --- a/idea/testData/slicer/inflow/delegateToJavaGetter.java +++ b/idea/testData/slicer/inflow/delegateToJavaGetter.java @@ -2,7 +2,7 @@ import kotlin.reflect.KProperty; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public class D { +class D { public static D INSTANCE = new D(); int getValue(@Nullable Object thisRef, @NotNull KProperty property) { diff --git a/idea/testData/slicer/inflow/diamondHierarchyJKMiddleClassFun.kt b/idea/testData/slicer/inflow/diamondHierarchyJKMiddleClassFun.kt index 09d3f597ee0..7a88b03ff63 100644 --- a/idea/testData/slicer/inflow/diamondHierarchyJKMiddleClassFun.kt +++ b/idea/testData/slicer/inflow/diamondHierarchyJKMiddleClassFun.kt @@ -4,7 +4,7 @@ open class B : A { override fun foo() = 2 } -fun test(a: A, b: B, c: C, d: D) { +internal fun test(a: A, b: B, c: C, d: D) { val x = a.foo() val y = b.foo() val z = c.foo() diff --git a/idea/testData/slicer/inflow/diamondHierarchyJKMiddleInterfaceFun.java b/idea/testData/slicer/inflow/diamondHierarchyJKMiddleInterfaceFun.java index 69a9690517c..d95cc7ff3aa 100644 --- a/idea/testData/slicer/inflow/diamondHierarchyJKMiddleInterfaceFun.java +++ b/idea/testData/slicer/inflow/diamondHierarchyJKMiddleInterfaceFun.java @@ -2,7 +2,7 @@ interface A { public int foo(); } -class B extends A { +class B implements A { public int foo() { return 2; } diff --git a/idea/testData/slicer/inflow/diamondHierarchyJKMiddleInterfaceFun.kt b/idea/testData/slicer/inflow/diamondHierarchyJKMiddleInterfaceFun.kt index 340abe9390b..952cc709c89 100644 --- a/idea/testData/slicer/inflow/diamondHierarchyJKMiddleInterfaceFun.kt +++ b/idea/testData/slicer/inflow/diamondHierarchyJKMiddleInterfaceFun.kt @@ -1,10 +1,10 @@ // FLOW: IN -interface C : A { +internal interface C : A { override fun foo() = 3 } -fun test(a: A, b: B, c: C, d: D) { +internal fun test(a: A, b: B, c: C, d: D) { val x = a.foo() val y = b.foo() val z = c.foo() diff --git a/idea/testData/slicer/inflow/diamondHierarchyJKRootInterfaceFun.kt b/idea/testData/slicer/inflow/diamondHierarchyJKRootInterfaceFun.kt index bcc284c7727..3578dde213a 100644 --- a/idea/testData/slicer/inflow/diamondHierarchyJKRootInterfaceFun.kt +++ b/idea/testData/slicer/inflow/diamondHierarchyJKRootInterfaceFun.kt @@ -4,7 +4,7 @@ interface A { fun foo() = 1 } -fun test(a: A, b: B, c: C, d: D) { +internal fun test(a: A, b: B, c: C, d: D) { val x = a.foo() val y = b.foo() val z = c.foo() diff --git a/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.kt b/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.kt index 5d8184f6814..6bf5511cdcd 100644 --- a/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.kt +++ b/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.kt @@ -12,7 +12,7 @@ fun foo(f: String.(Int) -> Unit) { fun test() { foo { - println(it) + val v = it } } diff --git a/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.leafGroups.txt b/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.leafGroups.txt index 0ba21e435ed..bc76f815561 100644 --- a/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.leafGroups.txt +++ b/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.leafGroups.txt @@ -1,17 +1,17 @@ 4 f("", 1) -15 println(it) +15 val v = it 14 [LAMBDA CALLS] foo { 3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { 4 f("", 1) 6 "".f(2) -15 println(it) +15 val v = it 14 [LAMBDA CALLS] foo { 3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { 6 "".f(2) 9 f(3) -15 println(it) +15 val v = it 14 [LAMBDA CALLS] foo { 3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { 9 f(3) diff --git a/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.nullnessGroups.txt b/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.nullnessGroups.txt index 7b0be39b1c7..616157e55ab 100644 --- a/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.nullnessGroups.txt @@ -1,4 +1,4 @@ [NotNull Values] -15 println(it) -15 println(it) +15 val v = it +15 val v = it diff --git a/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.results.txt b/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.results.txt index eb578f6015a..0afcb0bf3fa 100644 --- a/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.results.txt +++ b/idea/testData/slicer/inflow/extensionLambdaImplicitParameter.results.txt @@ -1,4 +1,4 @@ -15 println(it) +15 val v = it 14 [LAMBDA CALLS] foo { 3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { 4 f("", 1) diff --git a/idea/testData/slicer/inflow/extensionLambdaParameter.kt b/idea/testData/slicer/inflow/extensionLambdaParameter.kt index 9da17a22158..eeb43147214 100644 --- a/idea/testData/slicer/inflow/extensionLambdaParameter.kt +++ b/idea/testData/slicer/inflow/extensionLambdaParameter.kt @@ -12,7 +12,7 @@ fun foo(f: String.(Int) -> Unit) { fun test() { foo { i -> - println(i) + val v = i } } diff --git a/idea/testData/slicer/inflow/extensionLambdaParameter.leafGroups.txt b/idea/testData/slicer/inflow/extensionLambdaParameter.leafGroups.txt index b41a25af01e..9f625c5ca9f 100644 --- a/idea/testData/slicer/inflow/extensionLambdaParameter.leafGroups.txt +++ b/idea/testData/slicer/inflow/extensionLambdaParameter.leafGroups.txt @@ -1,19 +1,19 @@ 4 f("", 1) -15 println(i) +15 val v = i 14 foo { i -> 14 [LAMBDA CALLS] foo { i -> 3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { 4 f("", 1) 6 "".f(2) -15 println(i) +15 val v = i 14 foo { i -> 14 [LAMBDA CALLS] foo { i -> 3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { 6 "".f(2) 9 f(3) -15 println(i) +15 val v = i 14 foo { i -> 14 [LAMBDA CALLS] foo { i -> 3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { diff --git a/idea/testData/slicer/inflow/extensionLambdaParameter.nullnessGroups.txt b/idea/testData/slicer/inflow/extensionLambdaParameter.nullnessGroups.txt index d6ff54bc478..956e88c9371 100644 --- a/idea/testData/slicer/inflow/extensionLambdaParameter.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/extensionLambdaParameter.nullnessGroups.txt @@ -1,4 +1,4 @@ [NotNull Values] -15 println(i) -15 println(i) +15 val v = i +15 val v = i diff --git a/idea/testData/slicer/inflow/extensionLambdaParameter.results.txt b/idea/testData/slicer/inflow/extensionLambdaParameter.results.txt index 2b282650a36..f87457e46a3 100644 --- a/idea/testData/slicer/inflow/extensionLambdaParameter.results.txt +++ b/idea/testData/slicer/inflow/extensionLambdaParameter.results.txt @@ -1,4 +1,4 @@ -15 println(i) +15 val v = i 14 foo { i -> 14 [LAMBDA CALLS] foo { i -> 3 [LAMBDA CALLS] fun foo(f: String.(Int) -> Unit) { diff --git a/idea/testData/slicer/inflow/funParamerer.java b/idea/testData/slicer/inflow/funParamerer.java index c1e80c897f5..50aa95f4b9d 100644 --- a/idea/testData/slicer/inflow/funParamerer.java +++ b/idea/testData/slicer/inflow/funParamerer.java @@ -1,6 +1,6 @@ class J { void test() { - FunParamererKt.foo(1): - FunParamererKt.foo(1, "2"): + FunParamererKt.foo(1); + FunParamererKt.foo(1, "2"); } } \ No newline at end of file diff --git a/idea/testData/slicer/inflow/funParamerer.kt b/idea/testData/slicer/inflow/funParamerer.kt index 1efc153dbef..84e327045b8 100644 --- a/idea/testData/slicer/inflow/funParamerer.kt +++ b/idea/testData/slicer/inflow/funParamerer.kt @@ -1,4 +1,5 @@ // FLOW: IN +// WITH_RUNTIME @JvmOverloads fun foo(n: Int, s: String = "???") { diff --git a/idea/testData/slicer/inflow/funParamerer.leafGroups.txt b/idea/testData/slicer/inflow/funParamerer.leafGroups.txt index fdf8be6e6b6..45f758b29e7 100644 --- a/idea/testData/slicer/inflow/funParamerer.leafGroups.txt +++ b/idea/testData/slicer/inflow/funParamerer.leafGroups.txt @@ -1,8 +1,8 @@ -3 FunParamererKt.foo(1): -4 fun foo(n: Int, s: String = "???") { -3 FunParamererKt.foo(1): +3 FunParamererKt.foo(1); +5 fun foo(n: Int, s: String = "???") { +3 FunParamererKt.foo(1); -9 foo(1) -4 fun foo(n: Int, s: String = "???") { -9 foo(1) +10 foo(1) +5 fun foo(n: Int, s: String = "???") { +10 foo(1) diff --git a/idea/testData/slicer/inflow/funParamerer.nullnessGroups.txt b/idea/testData/slicer/inflow/funParamerer.nullnessGroups.txt index 689e74374f1..0ace9d1c663 100644 --- a/idea/testData/slicer/inflow/funParamerer.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/funParamerer.nullnessGroups.txt @@ -1,4 +1,4 @@ [NotNull Values] -4 fun foo(n: Int, s: String = "???") { -4 fun foo(n: Int, s: String = "???") { +5 fun foo(n: Int, s: String = "???") { +5 fun foo(n: Int, s: String = "???") { diff --git a/idea/testData/slicer/inflow/funParamerer.results.txt b/idea/testData/slicer/inflow/funParamerer.results.txt index 3636b559025..13f0b124e55 100644 --- a/idea/testData/slicer/inflow/funParamerer.results.txt +++ b/idea/testData/slicer/inflow/funParamerer.results.txt @@ -1,8 +1,8 @@ -4 fun foo(n: Int, s: String = "???") { -3 FunParamererKt.foo(1): -4 FunParamererKt.foo(1, "2"): -9 foo(1) -10 foo(1, "2") -11 foo(1, s = "2") -12 foo(n = 1, s = "2") -13 foo(s = "2", n = 1) +5 fun foo(n: Int, s: String = "???") { +3 FunParamererKt.foo(1); +4 FunParamererKt.foo(1, "2"); +10 foo(1) +11 foo(1, "2") +12 foo(1, s = "2") +13 foo(n = 1, s = "2") +14 foo(s = "2", n = 1) diff --git a/idea/testData/slicer/inflow/funParamererWithDefault.java b/idea/testData/slicer/inflow/funParamererWithDefault.java index 79878fb6178..cd75d1e61ce 100644 --- a/idea/testData/slicer/inflow/funParamererWithDefault.java +++ b/idea/testData/slicer/inflow/funParamererWithDefault.java @@ -1,6 +1,6 @@ class J { void test() { - FunParamererWithDefaultKt.foo(1): - FunParamererWithDefaultKt.foo(1, "2"): + FunParamererWithDefaultKt.foo(1); + FunParamererWithDefaultKt.foo(1, "2"); } } \ No newline at end of file diff --git a/idea/testData/slicer/inflow/funParamererWithDefault.kt b/idea/testData/slicer/inflow/funParamererWithDefault.kt index 10bd672ec56..83b292eac56 100644 --- a/idea/testData/slicer/inflow/funParamererWithDefault.kt +++ b/idea/testData/slicer/inflow/funParamererWithDefault.kt @@ -1,4 +1,5 @@ // FLOW: IN +// WITH_RUNTIME @JvmOverloads fun foo(n: Int, s: String = "???") { diff --git a/idea/testData/slicer/inflow/funParamererWithDefault.leafGroups.txt b/idea/testData/slicer/inflow/funParamererWithDefault.leafGroups.txt index 13c7ea56293..786ed9c6d5c 100644 --- a/idea/testData/slicer/inflow/funParamererWithDefault.leafGroups.txt +++ b/idea/testData/slicer/inflow/funParamererWithDefault.leafGroups.txt @@ -1,12 +1,12 @@ -4 FunParamererWithDefaultKt.foo(1, "2"): -4 fun foo(n: Int, s: String = "???") { -4 FunParamererWithDefaultKt.foo(1, "2"): +4 FunParamererWithDefaultKt.foo(1, "2"); +5 fun foo(n: Int, s: String = "???") { +4 FunParamererWithDefaultKt.foo(1, "2"); -10 foo(1, "2") -4 fun foo(n: Int, s: String = "???") { -10 foo(1, "2") +11 foo(1, "2") +5 fun foo(n: Int, s: String = "???") { +11 foo(1, "2") -4 fun foo(n: Int, s: String = "???") { -4 fun foo(n: Int, s: String = "???") { -4 fun foo(n: Int, s: String = "???") { +5 fun foo(n: Int, s: String = "???") { +5 fun foo(n: Int, s: String = "???") { +5 fun foo(n: Int, s: String = "???") { diff --git a/idea/testData/slicer/inflow/funParamererWithDefault.nullnessGroups.txt b/idea/testData/slicer/inflow/funParamererWithDefault.nullnessGroups.txt index ad2a142f82d..adccf5a64f1 100644 --- a/idea/testData/slicer/inflow/funParamererWithDefault.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/funParamererWithDefault.nullnessGroups.txt @@ -1,4 +1,4 @@ [NotNull Values] -4 fun foo(n: Int, s: String = "???") { -4 fun foo(n: Int, s: String = "???") { +5 fun foo(n: Int, s: String = "???") { +5 fun foo(n: Int, s: String = "???") { diff --git a/idea/testData/slicer/inflow/funParamererWithDefault.results.txt b/idea/testData/slicer/inflow/funParamererWithDefault.results.txt index d2696c7380b..e3dbfe55867 100644 --- a/idea/testData/slicer/inflow/funParamererWithDefault.results.txt +++ b/idea/testData/slicer/inflow/funParamererWithDefault.results.txt @@ -1,7 +1,7 @@ -4 fun foo(n: Int, s: String = "???") { -4 fun foo(n: Int, s: String = "???") { -10 foo(1, "2") -4 FunParamererWithDefaultKt.foo(1, "2"): -11 foo(1, s = "2") -12 foo(n = 1, s = "2") -13 foo(s = "2", n = 1) +5 fun foo(n: Int, s: String = "???") { +5 fun foo(n: Int, s: String = "???") { +4 FunParamererWithDefaultKt.foo(1, "2"); +11 foo(1, "2") +12 foo(1, s = "2") +13 foo(n = 1, s = "2") +14 foo(s = "2", n = 1) diff --git a/idea/testData/slicer/inflow/getterAndSetterUsingField.kt b/idea/testData/slicer/inflow/getterAndSetterUsingField.kt index 8ed3b27c040..585e09ec928 100644 --- a/idea/testData/slicer/inflow/getterAndSetterUsingField.kt +++ b/idea/testData/slicer/inflow/getterAndSetterUsingField.kt @@ -1,7 +1,7 @@ // FLOW: IN class A(var b: Boolean) { - var foo: Int + var foo: Int = -1 get() = if (b) field else 0 set(value) { field = if (b) value else 0 diff --git a/idea/testData/slicer/inflow/getterAndSetterUsingField.leafGroups.txt b/idea/testData/slicer/inflow/getterAndSetterUsingField.leafGroups.txt index d31f8a7664b..ccea0c4374b 100644 --- a/idea/testData/slicer/inflow/getterAndSetterUsingField.leafGroups.txt +++ b/idea/testData/slicer/inflow/getterAndSetterUsingField.leafGroups.txt @@ -1,6 +1,11 @@ +4 var foo: Int = -1 +11 val x = foo +4 var foo: Int = -1 +4 var foo: Int = -1 + 7 field = if (b) value else 0 11 val x = foo -4 var foo: Int +4 var foo: Int = -1 5 get() = if (b) field else 0 5 get() = if (b) field else 0 7 field = if (b) value else 0 @@ -8,7 +13,7 @@ 12 foo = 1 11 val x = foo -4 var foo: Int +4 var foo: Int = -1 5 get() = if (b) field else 0 5 get() = if (b) field else 0 7 field = if (b) value else 0 diff --git a/idea/testData/slicer/inflow/getterAndSetterUsingField.results.txt b/idea/testData/slicer/inflow/getterAndSetterUsingField.results.txt index f1dea8294be..5685e475f41 100644 --- a/idea/testData/slicer/inflow/getterAndSetterUsingField.results.txt +++ b/idea/testData/slicer/inflow/getterAndSetterUsingField.results.txt @@ -1,5 +1,6 @@ 11 val x = foo -4 var foo: Int +4 var foo: Int = -1 +4 var foo: Int = -1 5 get() = if (b) field else 0 5 get() = if (b) field else 0 7 field = if (b) value else 0 diff --git a/idea/testData/slicer/inflow/lambdaImplicitParameter.kt b/idea/testData/slicer/inflow/lambdaImplicitParameter.kt index 130c0cfb954..66ea947a265 100644 --- a/idea/testData/slicer/inflow/lambdaImplicitParameter.kt +++ b/idea/testData/slicer/inflow/lambdaImplicitParameter.kt @@ -1,11 +1,11 @@ // FLOW: IN -fun foo(f: (Int) -> Unit): Int { - return f(1) +fun foo(f: (Int) -> Unit) { + f(1) } fun test() { foo { - println(it) + val v = it } } \ No newline at end of file diff --git a/idea/testData/slicer/inflow/lambdaImplicitParameter.leafGroups.txt b/idea/testData/slicer/inflow/lambdaImplicitParameter.leafGroups.txt index 27b609d4b08..74c485a47ec 100644 --- a/idea/testData/slicer/inflow/lambdaImplicitParameter.leafGroups.txt +++ b/idea/testData/slicer/inflow/lambdaImplicitParameter.leafGroups.txt @@ -1,6 +1,6 @@ -4 return f(1) -9 println(it) +4 f(1) +9 val v = it 8 [LAMBDA CALLS] foo { -3 [LAMBDA CALLS] fun foo(f: (Int) -> Unit): Int { -4 return f(1) +3 [LAMBDA CALLS] fun foo(f: (Int) -> Unit) { +4 f(1) diff --git a/idea/testData/slicer/inflow/lambdaImplicitParameter.nullnessGroups.txt b/idea/testData/slicer/inflow/lambdaImplicitParameter.nullnessGroups.txt index 19c9185d0f6..ee2f622c201 100644 --- a/idea/testData/slicer/inflow/lambdaImplicitParameter.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/lambdaImplicitParameter.nullnessGroups.txt @@ -1,3 +1,4 @@ [NotNull Values] -9 println(it) -9 println(it) +9 val v = it +9 val v = it + diff --git a/idea/testData/slicer/inflow/lambdaImplicitParameter.results.txt b/idea/testData/slicer/inflow/lambdaImplicitParameter.results.txt index f90150738d7..29383bcc54e 100644 --- a/idea/testData/slicer/inflow/lambdaImplicitParameter.results.txt +++ b/idea/testData/slicer/inflow/lambdaImplicitParameter.results.txt @@ -1,4 +1,4 @@ -9 println(it) +9 val v = it 8 [LAMBDA CALLS] foo { -3 [LAMBDA CALLS] fun foo(f: (Int) -> Unit): Int { -4 return f(1) +3 [LAMBDA CALLS] fun foo(f: (Int) -> Unit) { +4 f(1) diff --git a/idea/testData/slicer/inflow/lambdaParameter.kt b/idea/testData/slicer/inflow/lambdaParameter.kt index a5d4b750176..55c9c42f30c 100644 --- a/idea/testData/slicer/inflow/lambdaParameter.kt +++ b/idea/testData/slicer/inflow/lambdaParameter.kt @@ -1,11 +1,11 @@ // FLOW: IN -fun foo(f: (Int) -> Unit): Int { - return f(1) +fun foo(f: (Int) -> Unit) { + f(1) } fun test() { foo { value -> - println(value) + val v = value } } \ No newline at end of file diff --git a/idea/testData/slicer/inflow/lambdaParameter.leafGroups.txt b/idea/testData/slicer/inflow/lambdaParameter.leafGroups.txt index 591d6bdc490..a8566b9388e 100644 --- a/idea/testData/slicer/inflow/lambdaParameter.leafGroups.txt +++ b/idea/testData/slicer/inflow/lambdaParameter.leafGroups.txt @@ -1,7 +1,7 @@ -4 return f(1) -9 println(value) +4 f(1) +9 val v = value 8 foo { value -> 8 [LAMBDA CALLS] foo { value -> -3 [LAMBDA CALLS] fun foo(f: (Int) -> Unit): Int { -4 return f(1) +3 [LAMBDA CALLS] fun foo(f: (Int) -> Unit) { +4 f(1) diff --git a/idea/testData/slicer/inflow/lambdaParameter.nullnessGroups.txt b/idea/testData/slicer/inflow/lambdaParameter.nullnessGroups.txt index c458ceed792..5eb3a447c8d 100644 --- a/idea/testData/slicer/inflow/lambdaParameter.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/lambdaParameter.nullnessGroups.txt @@ -1,3 +1,4 @@ [NotNull Values] -9 println(value) -9 println(value) +9 val v = value +9 val v = value + diff --git a/idea/testData/slicer/inflow/lambdaParameter.results.txt b/idea/testData/slicer/inflow/lambdaParameter.results.txt index c5d7ae68aa9..310aec04650 100644 --- a/idea/testData/slicer/inflow/lambdaParameter.results.txt +++ b/idea/testData/slicer/inflow/lambdaParameter.results.txt @@ -1,5 +1,5 @@ -9 println(value) +9 val v = value 8 foo { value -> 8 [LAMBDA CALLS] foo { value -> -3 [LAMBDA CALLS] fun foo(f: (Int) -> Unit): Int { -4 return f(1) +3 [LAMBDA CALLS] fun foo(f: (Int) -> Unit) { +4 f(1) diff --git a/idea/testData/slicer/inflow/noFieldInGetter.kt b/idea/testData/slicer/inflow/noFieldInGetter.kt index edb4f5c552f..edcdca6af9a 100644 --- a/idea/testData/slicer/inflow/noFieldInGetter.kt +++ b/idea/testData/slicer/inflow/noFieldInGetter.kt @@ -1,7 +1,7 @@ // FLOW: IN class A(var b: Boolean) { - var foo: Int + var foo: Int = 0 get() = 1 set(value) { field = value + 1 diff --git a/idea/testData/slicer/inflow/noFieldInGetter.leafGroups.txt b/idea/testData/slicer/inflow/noFieldInGetter.leafGroups.txt index 472677c44ab..d741c4706ad 100644 --- a/idea/testData/slicer/inflow/noFieldInGetter.leafGroups.txt +++ b/idea/testData/slicer/inflow/noFieldInGetter.leafGroups.txt @@ -1,5 +1,10 @@ +4 var foo: Int = 0 +11 val x = foo +4 var foo: Int = 0 +4 var foo: Int = 0 + 5 get() = 1 11 val x = foo -4 var foo: Int +4 var foo: Int = 0 5 get() = 1 diff --git a/idea/testData/slicer/inflow/noFieldInGetter.results.txt b/idea/testData/slicer/inflow/noFieldInGetter.results.txt index 9e747bd8702..e2f3ff1ad0d 100644 --- a/idea/testData/slicer/inflow/noFieldInGetter.results.txt +++ b/idea/testData/slicer/inflow/noFieldInGetter.results.txt @@ -1,3 +1,4 @@ 11 val x = foo -4 var foo: Int +4 var foo: Int = 0 +4 var foo: Int = 0 5 get() = 1 diff --git a/idea/testData/slicer/inflow/nullsAndNotNulls.kt b/idea/testData/slicer/inflow/nullsAndNotNulls.kt index eb8a497be20..2b1d04d23ea 100644 --- a/idea/testData/slicer/inflow/nullsAndNotNulls.kt +++ b/idea/testData/slicer/inflow/nullsAndNotNulls.kt @@ -1,6 +1,6 @@ // FLOW: IN -fun test(n: Int): String { +fun test(n: Int): String? { var s = when { n > 0 -> "+" n < 0 -> "-" diff --git a/idea/testData/slicer/inflow/onFunctionReceiverType.kt b/idea/testData/slicer/inflow/onFunctionReceiverType.kt index 17e71e4ba81..be680697653 100644 --- a/idea/testData/slicer/inflow/onFunctionReceiverType.kt +++ b/idea/testData/slicer/inflow/onFunctionReceiverType.kt @@ -1,4 +1,5 @@ // FLOW: IN +// WITH_RUNTIME @file: JvmName("KotlinUtil") diff --git a/idea/testData/slicer/inflow/onFunctionReceiverType.leafGroups.txt b/idea/testData/slicer/inflow/onFunctionReceiverType.leafGroups.txt index adb5234e9da..bcbf58d2aaa 100644 --- a/idea/testData/slicer/inflow/onFunctionReceiverType.leafGroups.txt +++ b/idea/testData/slicer/inflow/onFunctionReceiverType.leafGroups.txt @@ -1,17 +1,17 @@ -11 "".extensionFun() -7 fun Any.extensionFun() { -11 "".extensionFun() +12 "".extensionFun() +8 fun Any.extensionFun() { +12 "".extensionFun() -19 "A".foo() -7 fun Any.extensionFun() { -10 fun String.foo() { -19 "A".foo() +20 "A".foo() +8 fun Any.extensionFun() { +11 fun String.foo() { +20 "A".foo() 3 KotlinUtil.extensionFun("x"); -7 fun Any.extensionFun() { +8 fun Any.extensionFun() { 3 KotlinUtil.extensionFun("x"); -13 1.extensionFun() -7 fun Any.extensionFun() { -13 1.extensionFun() +14 1.extensionFun() +8 fun Any.extensionFun() { +14 1.extensionFun() diff --git a/idea/testData/slicer/inflow/onFunctionReceiverType.nullnessGroups.txt b/idea/testData/slicer/inflow/onFunctionReceiverType.nullnessGroups.txt index ce34565c438..9defdb355c8 100644 --- a/idea/testData/slicer/inflow/onFunctionReceiverType.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/onFunctionReceiverType.nullnessGroups.txt @@ -1,17 +1,17 @@ [NotNull Values] -11 "".extensionFun() -7 fun Any.extensionFun() { -11 "".extensionFun() -13 1.extensionFun() -7 fun Any.extensionFun() { -13 1.extensionFun() -19 "A".foo() -7 fun Any.extensionFun() { -10 fun String.foo() { -19 "A".foo() +12 "".extensionFun() +8 fun Any.extensionFun() { +12 "".extensionFun() +14 1.extensionFun() +8 fun Any.extensionFun() { +14 1.extensionFun() +20 "A".foo() +8 fun Any.extensionFun() { +11 fun String.foo() { +20 "A".foo() [Other Values] 3 KotlinUtil.extensionFun("x"); -7 fun Any.extensionFun() { +8 fun Any.extensionFun() { 3 KotlinUtil.extensionFun("x"); diff --git a/idea/testData/slicer/inflow/onFunctionReceiverType.results.txt b/idea/testData/slicer/inflow/onFunctionReceiverType.results.txt index 41a5b251139..2f9b039eb2a 100644 --- a/idea/testData/slicer/inflow/onFunctionReceiverType.results.txt +++ b/idea/testData/slicer/inflow/onFunctionReceiverType.results.txt @@ -1,6 +1,6 @@ -7 fun Any.extensionFun() { +8 fun Any.extensionFun() { 3 KotlinUtil.extensionFun("x"); -10 fun String.foo() { -19 "A".foo() -11 "".extensionFun() -13 1.extensionFun() +11 fun String.foo() { +20 "A".foo() +12 "".extensionFun() +14 1.extensionFun() diff --git a/idea/testData/slicer/inflow/onPropertyReceiverType.kt b/idea/testData/slicer/inflow/onPropertyReceiverType.kt index 6e92841310d..fc0b7198192 100644 --- a/idea/testData/slicer/inflow/onPropertyReceiverType.kt +++ b/idea/testData/slicer/inflow/onPropertyReceiverType.kt @@ -5,6 +5,6 @@ var Any.property: Int set(value) { } fun foo() { - println("a".property) + val v = "a".property "b".property = 2 } \ No newline at end of file diff --git a/idea/testData/slicer/inflow/onPropertyReceiverType.leafGroups.txt b/idea/testData/slicer/inflow/onPropertyReceiverType.leafGroups.txt index 59960990949..a89ba8c7206 100644 --- a/idea/testData/slicer/inflow/onPropertyReceiverType.leafGroups.txt +++ b/idea/testData/slicer/inflow/onPropertyReceiverType.leafGroups.txt @@ -2,6 +2,7 @@ 3 var Any.property: Int 9 "b".property = 2 -8 println("a".property) +8 val v = "a".property 3 var Any.property: Int -8 println("a".property) +8 val v = "a".property + diff --git a/idea/testData/slicer/inflow/onPropertyReceiverType.nullnessGroups.txt b/idea/testData/slicer/inflow/onPropertyReceiverType.nullnessGroups.txt index 68093133b5c..07179488696 100644 --- a/idea/testData/slicer/inflow/onPropertyReceiverType.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/onPropertyReceiverType.nullnessGroups.txt @@ -1,7 +1,8 @@ [NotNull Values] -8 println("a".property) +8 val v = "a".property 3 var Any.property: Int -8 println("a".property) +8 val v = "a".property 9 "b".property = 2 3 var Any.property: Int 9 "b".property = 2 + diff --git a/idea/testData/slicer/inflow/onPropertyReceiverType.results.txt b/idea/testData/slicer/inflow/onPropertyReceiverType.results.txt index 466a6164e25..764b81645cd 100644 --- a/idea/testData/slicer/inflow/onPropertyReceiverType.results.txt +++ b/idea/testData/slicer/inflow/onPropertyReceiverType.results.txt @@ -1,3 +1,3 @@ 3 var Any.property: Int -8 println("a".property) +8 val v = "a".property 9 "b".property = 2 diff --git a/idea/testData/slicer/inflow/openFun.kt b/idea/testData/slicer/inflow/openFun.kt index 3bde0ba15f4..565cb76b1f1 100644 --- a/idea/testData/slicer/inflow/openFun.kt +++ b/idea/testData/slicer/inflow/openFun.kt @@ -1,20 +1,21 @@ // FLOW: IN +// WITH_RUNTIME open class C { - var other: C? = null + private var other: C? = null - fun foo(p: Int) { + open fun foo(p: Int) { println(p + 1) other?.bar(p + 1) } - fun bar(p: Int) { + open fun bar(p: Int) { println(p + 2) } } class D : C() { - var other: D? = null + private var other: D? = null override fun foo(p: Int) { println(p + 3) diff --git a/idea/testData/slicer/inflow/openFun.leafGroups.txt b/idea/testData/slicer/inflow/openFun.leafGroups.txt index 763e319b1f9..8195b43666a 100644 --- a/idea/testData/slicer/inflow/openFun.leafGroups.txt +++ b/idea/testData/slicer/inflow/openFun.leafGroups.txt @@ -1,5 +1,5 @@ -8 other?.bar(p + 1) -12 println(p + 2) -11 fun bar(p: Int) { -8 other?.bar(p + 1) +9 other?.bar(p + 1) +13 println(p + 2) +12 open fun bar(p: Int) { +9 other?.bar(p + 1) diff --git a/idea/testData/slicer/inflow/openFun.nullnessGroups.txt b/idea/testData/slicer/inflow/openFun.nullnessGroups.txt index 0df649738ad..ee4ca595127 100644 --- a/idea/testData/slicer/inflow/openFun.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/openFun.nullnessGroups.txt @@ -1,4 +1,4 @@ [NotNull Values] -12 println(p + 2) -12 println(p + 2) +13 println(p + 2) +13 println(p + 2) diff --git a/idea/testData/slicer/inflow/openFun.results.txt b/idea/testData/slicer/inflow/openFun.results.txt index 757d3e8ceda..d48191e1b03 100644 --- a/idea/testData/slicer/inflow/openFun.results.txt +++ b/idea/testData/slicer/inflow/openFun.results.txt @@ -1,3 +1,3 @@ -12 println(p + 2) -11 fun bar(p: Int) { -8 other?.bar(p + 1) +13 println(p + 2) +12 open fun bar(p: Int) { +9 other?.bar(p + 1) diff --git a/idea/testData/slicer/inflow/openFunInvokeOnParameter.kt b/idea/testData/slicer/inflow/openFunInvokeOnParameter.kt index 4827b38f873..11e427fbd1f 100644 --- a/idea/testData/slicer/inflow/openFunInvokeOnParameter.kt +++ b/idea/testData/slicer/inflow/openFunInvokeOnParameter.kt @@ -1,20 +1,21 @@ // FLOW: IN +// WITH_RUNTIME open class C { - var other: C? = null + private var other: C? = null - fun foo(p: Int) { + open fun foo(p: Int) { println(p + 1) other?.bar(p + 1) } - fun bar(p: Int) { + open fun bar(p: Int) { println(p + 2) } } class D : C() { - var other: D? = null + private var other: D? = null override fun foo(p: Int) { println(p + 3) diff --git a/idea/testData/slicer/inflow/openFunInvokeOnParameter.leafGroups.txt b/idea/testData/slicer/inflow/openFunInvokeOnParameter.leafGroups.txt index 0a70b613117..a328960b267 100644 --- a/idea/testData/slicer/inflow/openFunInvokeOnParameter.leafGroups.txt +++ b/idea/testData/slicer/inflow/openFunInvokeOnParameter.leafGroups.txt @@ -1,7 +1,8 @@ -8 other?.bar(p + 1) -11 fun bar(p: Int) { -8 other?.bar(p + 1) +9 other?.bar(p + 1) +12 open fun bar(p: Int) { +9 other?.bar(p + 1) + +22 other?.bar(p + 3) +12 open fun bar(p: Int) { +22 other?.bar(p + 3) -21 other?.bar(p + 3) -11 fun bar(p: Int) { -21 other?.bar(p + 3) diff --git a/idea/testData/slicer/inflow/openFunInvokeOnParameter.nullnessGroups.txt b/idea/testData/slicer/inflow/openFunInvokeOnParameter.nullnessGroups.txt index 16f576f218e..d7e6b417f1c 100644 --- a/idea/testData/slicer/inflow/openFunInvokeOnParameter.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/openFunInvokeOnParameter.nullnessGroups.txt @@ -1,3 +1,4 @@ [NotNull Values] -11 fun bar(p: Int) { -11 fun bar(p: Int) { +12 open fun bar(p: Int) { +12 open fun bar(p: Int) { + diff --git a/idea/testData/slicer/inflow/openFunInvokeOnParameter.results.txt b/idea/testData/slicer/inflow/openFunInvokeOnParameter.results.txt index 918b91d0b46..91deb3ca9f4 100644 --- a/idea/testData/slicer/inflow/openFunInvokeOnParameter.results.txt +++ b/idea/testData/slicer/inflow/openFunInvokeOnParameter.results.txt @@ -1,3 +1,3 @@ -11 fun bar(p: Int) { -8 other?.bar(p + 1) -21 other?.bar(p + 3) +12 open fun bar(p: Int) { +9 other?.bar(p + 1) +22 other?.bar(p + 3) diff --git a/idea/testData/slicer/inflow/overrideExtension1.kt b/idea/testData/slicer/inflow/overrideExtension1.kt index 0fb108c769c..b47a71c51f9 100644 --- a/idea/testData/slicer/inflow/overrideExtension1.kt +++ b/idea/testData/slicer/inflow/overrideExtension1.kt @@ -2,7 +2,7 @@ open class Base { open fun Int.extensionFun() { - println(this) + val v = this } fun baseF() { diff --git a/idea/testData/slicer/inflow/overrideExtension1.leafGroups.txt b/idea/testData/slicer/inflow/overrideExtension1.leafGroups.txt index 6ee424d7e11..9dbb5c22904 100644 --- a/idea/testData/slicer/inflow/overrideExtension1.leafGroups.txt +++ b/idea/testData/slicer/inflow/overrideExtension1.leafGroups.txt @@ -1,4 +1,5 @@ 9 1.extensionFun() -5 println(this) +5 val v = this 4 open fun Int.extensionFun() { 9 1.extensionFun() + diff --git a/idea/testData/slicer/inflow/overrideExtension1.nullnessGroups.txt b/idea/testData/slicer/inflow/overrideExtension1.nullnessGroups.txt index 16596b0c63e..3cfce4a620a 100644 --- a/idea/testData/slicer/inflow/overrideExtension1.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/overrideExtension1.nullnessGroups.txt @@ -1,3 +1,4 @@ [NotNull Values] -5 println(this) -5 println(this) +5 val v = this +5 val v = this + diff --git a/idea/testData/slicer/inflow/overrideExtension1.results.txt b/idea/testData/slicer/inflow/overrideExtension1.results.txt index 2b37b4c287d..0eb6e87ee68 100644 --- a/idea/testData/slicer/inflow/overrideExtension1.results.txt +++ b/idea/testData/slicer/inflow/overrideExtension1.results.txt @@ -1,3 +1,3 @@ -5 println(this) +5 val v = this 4 open fun Int.extensionFun() { 9 1.extensionFun() diff --git a/idea/testData/slicer/inflow/overrideExtension2.kt b/idea/testData/slicer/inflow/overrideExtension2.kt index 0c006f104f8..f1837929c6d 100644 --- a/idea/testData/slicer/inflow/overrideExtension2.kt +++ b/idea/testData/slicer/inflow/overrideExtension2.kt @@ -2,7 +2,7 @@ open class Base { open fun Int.extensionFun() { - println(this) + val v = this } fun baseF() { diff --git a/idea/testData/slicer/inflow/overrideFun.kt b/idea/testData/slicer/inflow/overrideFun.kt index 34c14f9e154..9b77a0582ce 100644 --- a/idea/testData/slicer/inflow/overrideFun.kt +++ b/idea/testData/slicer/inflow/overrideFun.kt @@ -6,7 +6,7 @@ interface I { class C : I, JavaInterface { override fun foo(p: Int) { - println(p) + val v = p } fun f() { @@ -18,6 +18,6 @@ fun f(i: I) { i.foo(2) } -fun g(i: JavaInterface) { +internal fun g(i: JavaInterface) { i.foo(3) } diff --git a/idea/testData/slicer/inflow/overrideFun.leafGroups.txt b/idea/testData/slicer/inflow/overrideFun.leafGroups.txt index d7057d81bbe..3da0399e37a 100644 --- a/idea/testData/slicer/inflow/overrideFun.leafGroups.txt +++ b/idea/testData/slicer/inflow/overrideFun.leafGroups.txt @@ -1,15 +1,15 @@ 2 void foo(int p); -9 println(p) +9 val v = p 8 override fun foo(p: Int) { 2 void foo(int p); 13 foo(1) -9 println(p) +9 val v = p 8 override fun foo(p: Int) { 13 foo(1) 18 i.foo(2) -9 println(p) +9 val v = p 8 override fun foo(p: Int) { 18 i.foo(2) diff --git a/idea/testData/slicer/inflow/overrideFun.nullnessGroups.txt b/idea/testData/slicer/inflow/overrideFun.nullnessGroups.txt index 3756dff8a11..00f079584f5 100644 --- a/idea/testData/slicer/inflow/overrideFun.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/overrideFun.nullnessGroups.txt @@ -1,3 +1,4 @@ [NotNull Values] -9 println(p) -9 println(p) +9 val v = p +9 val v = p + diff --git a/idea/testData/slicer/inflow/overrideFun.results.txt b/idea/testData/slicer/inflow/overrideFun.results.txt index 7b01acd65eb..1b02e1cfcf4 100644 --- a/idea/testData/slicer/inflow/overrideFun.results.txt +++ b/idea/testData/slicer/inflow/overrideFun.results.txt @@ -1,4 +1,4 @@ -9 println(p) +9 val v = p 8 override fun foo(p: Int) { 2 void foo(int p); 13 foo(1) diff --git a/idea/testData/slicer/inflow/overridingParameter.java b/idea/testData/slicer/inflow/overridingParameter.java index b74de266109..d5b9ee04c0e 100644 --- a/idea/testData/slicer/inflow/overridingParameter.java +++ b/idea/testData/slicer/inflow/overridingParameter.java @@ -1,4 +1,8 @@ class D extends B { + D() { + super(10); + } + public int getFoo() { return 5; } diff --git a/idea/testData/slicer/inflow/overridingParameter.kt b/idea/testData/slicer/inflow/overridingParameter.kt index f612dd96812..95bee9b9d4f 100644 --- a/idea/testData/slicer/inflow/overridingParameter.kt +++ b/idea/testData/slicer/inflow/overridingParameter.kt @@ -6,7 +6,7 @@ open class A { open class B(override val foo: Int) : A() -class C : B() { +class C : B(1) { override val foo = 3 } diff --git a/idea/testData/slicer/inflow/overridingParameter.leafGroups.txt b/idea/testData/slicer/inflow/overridingParameter.leafGroups.txt index 1273c77f19e..88a8b4b6555 100644 --- a/idea/testData/slicer/inflow/overridingParameter.leafGroups.txt +++ b/idea/testData/slicer/inflow/overridingParameter.leafGroups.txt @@ -1,7 +1,8 @@ -7 open class B(override val foo: Int) : A() +9 class C : B(1) { 15 val y = b.foo 15 val y = b.foo 7 open class B(override val foo: Int) : A() +9 class C : B(1) { 10 override val foo = 3 15 val y = b.foo @@ -9,8 +10,14 @@ 10 override val foo = 3 10 override val foo = 3 -3 return 5; +7 return 5; 15 val y = b.foo 15 val y = b.foo -3 return 5; +7 return 5; + +3 super(10); +15 val y = b.foo +15 val y = b.foo +7 open class B(override val foo: Int) : A() +3 super(10); diff --git a/idea/testData/slicer/inflow/overridingParameter.results.txt b/idea/testData/slicer/inflow/overridingParameter.results.txt index c908a595eb8..3a5d9032bd0 100644 --- a/idea/testData/slicer/inflow/overridingParameter.results.txt +++ b/idea/testData/slicer/inflow/overridingParameter.results.txt @@ -1,6 +1,8 @@ 15 val y = b.foo 15 val y = b.foo -3 return 5; 7 open class B(override val foo: Int) : A() +3 super(10); +9 class C : B(1) { +7 return 5; 10 override val foo = 3 10 override val foo = 3 diff --git a/idea/testData/slicer/inflow/primaryConstructorParameter.kt b/idea/testData/slicer/inflow/primaryConstructorParameter.kt index ea2aabff57a..712471fd72f 100644 --- a/idea/testData/slicer/inflow/primaryConstructorParameter.kt +++ b/idea/testData/slicer/inflow/primaryConstructorParameter.kt @@ -1,4 +1,5 @@ // FLOW: IN +// WITH_RUNTIME open class A @JvmOverloads constructor(n: Int, s: String = "???") diff --git a/idea/testData/slicer/inflow/primaryConstructorParameter.leafGroups.txt b/idea/testData/slicer/inflow/primaryConstructorParameter.leafGroups.txt index 6a790b235e2..380b2bb4af2 100644 --- a/idea/testData/slicer/inflow/primaryConstructorParameter.leafGroups.txt +++ b/idea/testData/slicer/inflow/primaryConstructorParameter.leafGroups.txt @@ -1,13 +1,13 @@ 2 D(int n, String s) { -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") 3 super(n, s); 2 D(int n, String s) { -5 class B1: A(1) -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") -5 class B1: A(1) +6 class B1: A(1) +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") +6 class B1: A(1) 11 new A(1); -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") 11 new A(1); diff --git a/idea/testData/slicer/inflow/primaryConstructorParameter.nullnessGroups.txt b/idea/testData/slicer/inflow/primaryConstructorParameter.nullnessGroups.txt index 4b15ff6ecb1..c9c3506df05 100644 --- a/idea/testData/slicer/inflow/primaryConstructorParameter.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/primaryConstructorParameter.nullnessGroups.txt @@ -1,4 +1,4 @@ [NotNull Values] -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") diff --git a/idea/testData/slicer/inflow/primaryConstructorParameter.results.txt b/idea/testData/slicer/inflow/primaryConstructorParameter.results.txt index 8e05806b9ba..3f122ab4b7e 100644 --- a/idea/testData/slicer/inflow/primaryConstructorParameter.results.txt +++ b/idea/testData/slicer/inflow/primaryConstructorParameter.results.txt @@ -1,17 +1,17 @@ -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") 3 super(n, s); 2 D(int n, String s) { -5 class B1: A(1) 7 super(n); 6 D(int n) { -6 class B2: A(1, "2") -7 class B3: A(1, s = "2") +6 class B1: A(1) +7 class B2: A(1, "2") +8 class B3: A(1, s = "2") 11 new A(1); -8 class B4: A(n = 1, s = "2") 12 new A(1, "2"); -9 class B5: A(s = "2", n = 1) -12 A(1) -13 A(1, "2") -14 A(1, s = "2") -15 A(n = 1, s = "2") -16 A(s = "2", n = 1) +9 class B4: A(n = 1, s = "2") +10 class B5: A(s = "2", n = 1) +13 A(1) +14 A(1, "2") +15 A(1, s = "2") +16 A(n = 1, s = "2") +17 A(s = "2", n = 1) diff --git a/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.kt b/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.kt index 92f566a6850..d68026d5e79 100644 --- a/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.kt +++ b/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.kt @@ -1,4 +1,5 @@ // FLOW: IN +// WITH_RUNTIME open class A @JvmOverloads constructor(n: Int, s: String = "???") diff --git a/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.leafGroups.txt b/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.leafGroups.txt index fb2729d4947..a022f906729 100644 --- a/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.leafGroups.txt +++ b/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.leafGroups.txt @@ -1,17 +1,17 @@ -6 class B2: A(1, "2") -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") -6 class B2: A(1, "2") +7 class B2: A(1, "2") +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") +7 class B2: A(1, "2") 12 new A(1, "2"); -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") 12 new A(1, "2"); 2 D(int n, String s) { -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") 3 super(n, s); 2 D(int n, String s) { -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") diff --git a/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.nullnessGroups.txt b/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.nullnessGroups.txt index 9e4da8dfe3f..25ce322b702 100644 --- a/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.nullnessGroups.txt @@ -1,4 +1,4 @@ [NotNull Values] -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") diff --git a/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.results.txt b/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.results.txt index 56c16a150d9..8186f0bbfd9 100644 --- a/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.results.txt +++ b/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.results.txt @@ -1,13 +1,13 @@ -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") 3 super(n, s); 2 D(int n, String s) { -3 open class A @JvmOverloads constructor(n: Int, s: String = "???") -6 class B2: A(1, "2") -7 class B3: A(1, s = "2") -8 class B4: A(n = 1, s = "2") +4 open class A @JvmOverloads constructor(n: Int, s: String = "???") +7 class B2: A(1, "2") +8 class B3: A(1, s = "2") 12 new A(1, "2"); -9 class B5: A(s = "2", n = 1) -13 A(1, "2") -14 A(1, s = "2") -15 A(n = 1, s = "2") -16 A(s = "2", n = 1) +9 class B4: A(n = 1, s = "2") +10 class B5: A(s = "2", n = 1) +14 A(1, "2") +15 A(1, s = "2") +16 A(n = 1, s = "2") +17 A(s = "2", n = 1) diff --git a/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.kt b/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.kt index a43f50e3ef7..e116c888ef2 100644 --- a/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.kt +++ b/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.kt @@ -5,12 +5,12 @@ class AClass(name1: String){ fun uses(){ name = "uses: bye" this.name = "uses: after this" - println("And now my name is '$name'") + val v = "And now my name is '$name'" } } fun main(args: Array) { val a = AClass("main: hello") a.name = "main: bye" - println("Now my name is '${a.name}'") + val v = "Now my name is '${a.name}'" } \ No newline at end of file diff --git a/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.leafGroups.txt b/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.leafGroups.txt index 56c3ddbe824..1e804b6d306 100644 --- a/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.leafGroups.txt +++ b/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.leafGroups.txt @@ -1,21 +1,22 @@ 13 val a = AClass("main: hello") -15 println("Now my name is '${a.name}'") +15 val v = "Now my name is '${a.name}'" 4 var name : String = name1 4 var name : String = name1 3 class AClass(name1: String){ 13 val a = AClass("main: hello") 14 a.name = "main: bye" -15 println("Now my name is '${a.name}'") +15 val v = "Now my name is '${a.name}'" 4 var name : String = name1 14 a.name = "main: bye" 6 name = "uses: bye" -15 println("Now my name is '${a.name}'") +15 val v = "Now my name is '${a.name}'" 4 var name : String = name1 6 name = "uses: bye" 7 this.name = "uses: after this" -15 println("Now my name is '${a.name}'") +15 val v = "Now my name is '${a.name}'" 4 var name : String = name1 7 this.name = "uses: after this" + diff --git a/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.nullnessGroups.txt b/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.nullnessGroups.txt index 54dbefbbb34..caecd13d4e0 100644 --- a/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.nullnessGroups.txt @@ -1,3 +1,4 @@ [NotNull Values] -15 println("Now my name is '${a.name}'") -15 println("Now my name is '${a.name}'") +15 val v = "Now my name is '${a.name}'" +15 val v = "Now my name is '${a.name}'" + diff --git a/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.results.txt b/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.results.txt index 114d6178665..8016cb26001 100644 --- a/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.results.txt +++ b/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.results.txt @@ -1,4 +1,4 @@ -15 println("Now my name is '${a.name}'") +15 val v = "Now my name is '${a.name}'" 4 var name : String = name1 4 var name : String = name1 3 class AClass(name1: String){ diff --git a/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.kt b/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.kt index 3b92d3b03ba..b96f4eed0c5 100644 --- a/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.kt +++ b/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.kt @@ -5,12 +5,12 @@ class AClass(name1: String){ fun uses(){ name = "uses: bye" this.name = "uses: after this" - println("And now my name is '$name'") + val v = "And now my name is '$name'" } } fun main(args: Array) { val a = AClass("main: hello") a.name = "main: bye" - println("Now my name is '${a.name}'") + val v = "Now my name is '${a.name}'" } \ No newline at end of file diff --git a/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.leafGroups.txt b/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.leafGroups.txt index b0f7bdd8861..0f5c0dab4ea 100644 --- a/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.leafGroups.txt +++ b/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.leafGroups.txt @@ -1,21 +1,22 @@ 13 val a = AClass("main: hello") -8 println("And now my name is '$name'") +8 val v = "And now my name is '$name'" 4 var name : String = name1 4 var name : String = name1 3 class AClass(name1: String){ 13 val a = AClass("main: hello") 14 a.name = "main: bye" -8 println("And now my name is '$name'") +8 val v = "And now my name is '$name'" 4 var name : String = name1 14 a.name = "main: bye" 6 name = "uses: bye" -8 println("And now my name is '$name'") +8 val v = "And now my name is '$name'" 4 var name : String = name1 6 name = "uses: bye" 7 this.name = "uses: after this" -8 println("And now my name is '$name'") +8 val v = "And now my name is '$name'" 4 var name : String = name1 7 this.name = "uses: after this" + diff --git a/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.nullnessGroups.txt b/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.nullnessGroups.txt index 17320da76c0..2afdcc3cabc 100644 --- a/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.nullnessGroups.txt @@ -1,3 +1,4 @@ [NotNull Values] -8 println("And now my name is '$name'") -8 println("And now my name is '$name'") +8 val v = "And now my name is '$name'" +8 val v = "And now my name is '$name'" + diff --git a/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.results.txt b/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.results.txt index 1ab66d7c9a4..db0e3a06bd4 100644 --- a/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.results.txt +++ b/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.results.txt @@ -1,4 +1,4 @@ -8 println("And now my name is '$name'") +8 val v = "And now my name is '$name'" 4 var name : String = name1 4 var name : String = name1 3 class AClass(name1: String){ diff --git a/idea/testData/slicer/inflow/secondaryConstructorParameter.kt b/idea/testData/slicer/inflow/secondaryConstructorParameter.kt index 2610000ef6a..624046bc625 100644 --- a/idea/testData/slicer/inflow/secondaryConstructorParameter.kt +++ b/idea/testData/slicer/inflow/secondaryConstructorParameter.kt @@ -1,4 +1,5 @@ // FLOW: IN +// WITH_RUNTIME open class A { @JvmOverloads constructor(n: Int, s: String = "???") diff --git a/idea/testData/slicer/inflow/secondaryConstructorParameter.leafGroups.txt b/idea/testData/slicer/inflow/secondaryConstructorParameter.leafGroups.txt index 441a70f6e54..b3c18761878 100644 --- a/idea/testData/slicer/inflow/secondaryConstructorParameter.leafGroups.txt +++ b/idea/testData/slicer/inflow/secondaryConstructorParameter.leafGroups.txt @@ -1,13 +1,13 @@ 2 D(int n, String s) { -4 @JvmOverloads constructor(n: Int, s: String = "???") +5 @JvmOverloads constructor(n: Int, s: String = "???") 3 super(n, s); 2 D(int n, String s) { -7 class B1: A(1) -4 @JvmOverloads constructor(n: Int, s: String = "???") -7 class B1: A(1) +8 class B1: A(1) +5 @JvmOverloads constructor(n: Int, s: String = "???") +8 class B1: A(1) 11 new A(1); -4 @JvmOverloads constructor(n: Int, s: String = "???") +5 @JvmOverloads constructor(n: Int, s: String = "???") 11 new A(1); diff --git a/idea/testData/slicer/inflow/secondaryConstructorParameter.nullnessGroups.txt b/idea/testData/slicer/inflow/secondaryConstructorParameter.nullnessGroups.txt index 83966cc7d7c..5ea9e70910a 100644 --- a/idea/testData/slicer/inflow/secondaryConstructorParameter.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/secondaryConstructorParameter.nullnessGroups.txt @@ -1,4 +1,4 @@ [NotNull Values] -4 @JvmOverloads constructor(n: Int, s: String = "???") -4 @JvmOverloads constructor(n: Int, s: String = "???") +5 @JvmOverloads constructor(n: Int, s: String = "???") +5 @JvmOverloads constructor(n: Int, s: String = "???") diff --git a/idea/testData/slicer/inflow/secondaryConstructorParameter.results.txt b/idea/testData/slicer/inflow/secondaryConstructorParameter.results.txt index c2d239a6067..e5aa1882949 100644 --- a/idea/testData/slicer/inflow/secondaryConstructorParameter.results.txt +++ b/idea/testData/slicer/inflow/secondaryConstructorParameter.results.txt @@ -1,17 +1,17 @@ -4 @JvmOverloads constructor(n: Int, s: String = "???") +5 @JvmOverloads constructor(n: Int, s: String = "???") 3 super(n, s); 2 D(int n, String s) { -7 class B1: A(1) 7 super(n); 6 D(int n) { -8 class B2: A(1, "2") -9 class B3: A(1, s = "2") +8 class B1: A(1) +9 class B2: A(1, "2") 11 new A(1); -10 class B4: A(n = 1, s = "2") +10 class B3: A(1, s = "2") 12 new A(1, "2"); -11 class B5: A(s = "2", n = 1) -14 A(1) -15 A(1, "2") -16 A(1, s = "2") -17 A(n = 1, s = "2") -18 A(s = "2", n = 1) +11 class B4: A(n = 1, s = "2") +12 class B5: A(s = "2", n = 1) +15 A(1) +16 A(1, "2") +17 A(1, s = "2") +18 A(n = 1, s = "2") +19 A(s = "2", n = 1) diff --git a/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.kt b/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.kt index cd6b1a7e80c..1fc1bdc745f 100644 --- a/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.kt +++ b/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.kt @@ -1,4 +1,5 @@ // FLOW: IN +// WITH_RUNTIME open class A { @JvmOverloads constructor(n: Int, s: String = "???") diff --git a/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.leafGroups.txt b/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.leafGroups.txt index 3a7ec215f14..fd7f749547d 100644 --- a/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.leafGroups.txt +++ b/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.leafGroups.txt @@ -1,17 +1,17 @@ -8 class B2: A(1, "2") -4 @JvmOverloads constructor(n: Int, s: String = "???") -8 class B2: A(1, "2") +9 class B2: A(1, "2") +5 @JvmOverloads constructor(n: Int, s: String = "???") +9 class B2: A(1, "2") 12 new A(1, "2"); -4 @JvmOverloads constructor(n: Int, s: String = "???") +5 @JvmOverloads constructor(n: Int, s: String = "???") 12 new A(1, "2"); 2 D(int n, String s) { -4 @JvmOverloads constructor(n: Int, s: String = "???") +5 @JvmOverloads constructor(n: Int, s: String = "???") 3 super(n, s); 2 D(int n, String s) { -4 @JvmOverloads constructor(n: Int, s: String = "???") -4 @JvmOverloads constructor(n: Int, s: String = "???") -4 @JvmOverloads constructor(n: Int, s: String = "???") +5 @JvmOverloads constructor(n: Int, s: String = "???") +5 @JvmOverloads constructor(n: Int, s: String = "???") +5 @JvmOverloads constructor(n: Int, s: String = "???") diff --git a/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.nullnessGroups.txt b/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.nullnessGroups.txt index 15fab3feda7..40daf1481b9 100644 --- a/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.nullnessGroups.txt @@ -1,4 +1,4 @@ [NotNull Values] -4 @JvmOverloads constructor(n: Int, s: String = "???") -4 @JvmOverloads constructor(n: Int, s: String = "???") +5 @JvmOverloads constructor(n: Int, s: String = "???") +5 @JvmOverloads constructor(n: Int, s: String = "???") diff --git a/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.results.txt b/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.results.txt index 909d1d6801e..e35375b7ebc 100644 --- a/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.results.txt +++ b/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.results.txt @@ -1,13 +1,13 @@ -4 @JvmOverloads constructor(n: Int, s: String = "???") +5 @JvmOverloads constructor(n: Int, s: String = "???") 3 super(n, s); 2 D(int n, String s) { -4 @JvmOverloads constructor(n: Int, s: String = "???") -8 class B2: A(1, "2") -9 class B3: A(1, s = "2") +5 @JvmOverloads constructor(n: Int, s: String = "???") +9 class B2: A(1, "2") +10 class B3: A(1, s = "2") 12 new A(1, "2"); -10 class B4: A(n = 1, s = "2") -11 class B5: A(s = "2", n = 1) -15 A(1, "2") -16 A(1, s = "2") -17 A(n = 1, s = "2") -18 A(s = "2", n = 1) +11 class B4: A(n = 1, s = "2") +12 class B5: A(s = "2", n = 1) +16 A(1, "2") +17 A(1, s = "2") +18 A(n = 1, s = "2") +19 A(s = "2", n = 1) diff --git a/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.kt b/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.kt index e688a13516f..fbae8f86246 100644 --- a/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.kt +++ b/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.kt @@ -1,4 +1,6 @@ // FLOW: IN +// WITH_RUNTIME +import kotlin.reflect.KProperty class Delegate { private var _value: String = "" diff --git a/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.leafGroups.txt b/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.leafGroups.txt index 7b6728cb82a..43bfcbc413d 100644 --- a/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.leafGroups.txt +++ b/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.leafGroups.txt @@ -1,29 +1,30 @@ -4 private var _value: String = "" -25 println("My name is '${a.name}'") -12 var name by Delegate() -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -4 private var _value: String = "" -4 private var _value: String = "" +6 private var _value: String = "" +27 println("My name is '${a.name}'") +14 var name by Delegate() +7 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +7 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +6 private var _value: String = "" +6 private var _value: String = "" -18 name = "bye" -25 println("My name is '${a.name}'") -12 var name by Delegate() -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -4 private var _value: String = "" -7 _value = value -6 operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) { -18 name = "bye" +20 name = "bye" +27 println("My name is '${a.name}'") +14 var name by Delegate() +7 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +7 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +6 private var _value: String = "" +9 _value = value +8 operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) { +20 name = "bye" + +26 val a = AClass("hello") +27 println("My name is '${a.name}'") +14 var name by Delegate() +7 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +7 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +6 private var _value: String = "" +9 _value = value +8 operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) { +16 name = name1 +13 class AClass(name1: String){ +26 val a = AClass("hello") -24 val a = AClass("hello") -25 println("My name is '${a.name}'") -12 var name by Delegate() -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -4 private var _value: String = "" -7 _value = value -6 operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) { -14 name = name1 -11 class AClass(name1: String){ -24 val a = AClass("hello") diff --git a/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.nullnessGroups.txt b/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.nullnessGroups.txt index 56e41c7ae5b..b0b217cfa7a 100644 --- a/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.nullnessGroups.txt @@ -1,3 +1,4 @@ [NotNull Values] -25 println("My name is '${a.name}'") -25 println("My name is '${a.name}'") +27 println("My name is '${a.name}'") +27 println("My name is '${a.name}'") + diff --git a/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.results.txt b/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.results.txt index b0be23fe512..e484fbf45df 100644 --- a/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.results.txt +++ b/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.results.txt @@ -1,12 +1,12 @@ -25 println("My name is '${a.name}'") -12 var name by Delegate() -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -4 private var _value: String = "" -4 private var _value: String = "" -7 _value = value -6 operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) { -14 name = name1 -11 class AClass(name1: String){ -24 val a = AClass("hello") -18 name = "bye" +27 println("My name is '${a.name}'") +14 var name by Delegate() +7 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +7 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +6 private var _value: String = "" +6 private var _value: String = "" +9 _value = value +8 operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) { +16 name = name1 +13 class AClass(name1: String){ +26 val a = AClass("hello") +20 name = "bye" diff --git a/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.kt b/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.kt index f59e8b6a245..f3fd1352f80 100644 --- a/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.kt +++ b/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.kt @@ -1,4 +1,7 @@ // FLOW: IN +// RUNTIME_WITH_REFLECT + +import kotlin.reflect.KProperty class Delegate { private var _value: String = "" diff --git a/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.leafGroups.txt b/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.leafGroups.txt index 8c9dccb835b..5c284d70511 100644 --- a/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.leafGroups.txt +++ b/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.leafGroups.txt @@ -1,29 +1,30 @@ -4 private var _value: String = "" -19 println("Now my name is '$name'") -12 var name by Delegate() -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -4 private var _value: String = "" -4 private var _value: String = "" +7 private var _value: String = "" +22 println("Now my name is '$name'") +15 var name by Delegate() +8 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +8 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +7 private var _value: String = "" +7 private var _value: String = "" -18 name = "bye" -19 println("Now my name is '$name'") -12 var name by Delegate() -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -4 private var _value: String = "" -7 _value = value -6 operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) { -18 name = "bye" +21 name = "bye" +22 println("Now my name is '$name'") +15 var name by Delegate() +8 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +8 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +7 private var _value: String = "" +10 _value = value +9 operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) { +21 name = "bye" + +27 val a = AClass("hello") +22 println("Now my name is '$name'") +15 var name by Delegate() +8 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +8 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +7 private var _value: String = "" +10 _value = value +9 operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) { +17 name = name1 +14 class AClass(name1: String){ +27 val a = AClass("hello") -24 val a = AClass("hello") -19 println("Now my name is '$name'") -12 var name by Delegate() -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -4 private var _value: String = "" -7 _value = value -6 operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) { -14 name = name1 -11 class AClass(name1: String){ -24 val a = AClass("hello") diff --git a/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.nullnessGroups.txt b/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.nullnessGroups.txt index fc530508727..05e1ce43eb1 100644 --- a/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.nullnessGroups.txt @@ -1,3 +1,4 @@ [NotNull Values] -19 println("Now my name is '$name'") -19 println("Now my name is '$name'") +22 println("Now my name is '$name'") +22 println("Now my name is '$name'") + diff --git a/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.results.txt b/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.results.txt index e6a4390b677..e5b693711e8 100644 --- a/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.results.txt +++ b/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.results.txt @@ -1,12 +1,12 @@ -19 println("Now my name is '$name'") -12 var name by Delegate() -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -5 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value -4 private var _value: String = "" -4 private var _value: String = "" -7 _value = value -6 operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) { -14 name = name1 -11 class AClass(name1: String){ -24 val a = AClass("hello") -18 name = "bye" +22 println("Now my name is '$name'") +15 var name by Delegate() +8 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +8 operator fun getValue(thisRef: Any?, property: KProperty<*>) = _value +7 private var _value: String = "" +7 private var _value: String = "" +10 _value = value +9 operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) { +17 name = name1 +14 class AClass(name1: String){ +27 val a = AClass("hello") +21 name = "bye" diff --git a/idea/testData/slicer/inflow/settersViaJavaDelegate.java b/idea/testData/slicer/inflow/settersViaJavaDelegate.java index cb94502d929..0fc52128bf5 100644 --- a/idea/testData/slicer/inflow/settersViaJavaDelegate.java +++ b/idea/testData/slicer/inflow/settersViaJavaDelegate.java @@ -2,10 +2,10 @@ import kotlin.reflect.KProperty; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public class D { +class D { private String _value = ""; - int getValue(@Nullable Object thisRef, @NotNull KProperty property) { + String getValue(@Nullable Object thisRef, @NotNull KProperty property) { return _value; } diff --git a/idea/testData/slicer/inflow/settersViaJavaDelegate.leafGroups.txt b/idea/testData/slicer/inflow/settersViaJavaDelegate.leafGroups.txt index 50565355300..f4c5e828efe 100644 --- a/idea/testData/slicer/inflow/settersViaJavaDelegate.leafGroups.txt +++ b/idea/testData/slicer/inflow/settersViaJavaDelegate.leafGroups.txt @@ -4,9 +4,11 @@ 9 return _value; 6 private String _value = ""; -12 void setValue(@Nullable Object thisRef, @NotNull KProperty property, @NotNull String value) { +5 var name by D() 12 println("Now my name is '$name'") 5 var name by D() 9 return _value; 13 _value = value; 12 void setValue(@Nullable Object thisRef, @NotNull KProperty property, @NotNull String value) { +5 var name by D() + diff --git a/idea/testData/slicer/inflow/settersViaJavaDelegate.nullnessGroups.txt b/idea/testData/slicer/inflow/settersViaJavaDelegate.nullnessGroups.txt index 2757ee585bb..60491b3dc2b 100644 --- a/idea/testData/slicer/inflow/settersViaJavaDelegate.nullnessGroups.txt +++ b/idea/testData/slicer/inflow/settersViaJavaDelegate.nullnessGroups.txt @@ -1,3 +1,14 @@ -[NotNull Values] -12 println("Now my name is '$name'") +[Other Values] +5 var name by D() 12 println("Now my name is '$name'") +5 var name by D() +9 return _value; +13 _value = value; +12 void setValue(@Nullable Object thisRef, @NotNull KProperty property, @NotNull String value) { +5 var name by D() +6 private String _value = ""; +12 println("Now my name is '$name'") +5 var name by D() +9 return _value; +6 private String _value = ""; + diff --git a/idea/testData/slicer/inflow/settersViaJavaDelegate.results.txt b/idea/testData/slicer/inflow/settersViaJavaDelegate.results.txt index 14ba16fc7bc..5838dfd8dac 100644 --- a/idea/testData/slicer/inflow/settersViaJavaDelegate.results.txt +++ b/idea/testData/slicer/inflow/settersViaJavaDelegate.results.txt @@ -4,3 +4,4 @@ 6 private String _value = ""; 13 _value = value; 12 void setValue(@Nullable Object thisRef, @NotNull KProperty property, @NotNull String value) { +5 var name by D() diff --git a/idea/testData/slicer/outflow/abstractExtensionMethodParameter.kt b/idea/testData/slicer/outflow/abstractExtensionMethodParameter.kt index 56ac652ce39..bb88ec5ed3d 100644 --- a/idea/testData/slicer/outflow/abstractExtensionMethodParameter.kt +++ b/idea/testData/slicer/outflow/abstractExtensionMethodParameter.kt @@ -6,7 +6,7 @@ interface I { class C1 : I { override fun Int.foo(p: Any) { - println(p) // this usage will be shown twice due to bug in Java implementation: https://youtrack.jetbrains.com/issue/IDEA-236958 + val v = p // this usage will be shown twice due to bug in Java implementation: https://youtrack.jetbrains.com/issue/IDEA-236958 } } diff --git a/idea/testData/slicer/outflow/abstractExtensionMethodParameter.results.txt b/idea/testData/slicer/outflow/abstractExtensionMethodParameter.results.txt index 2975c1b0f4c..5061672bb4e 100644 --- a/idea/testData/slicer/outflow/abstractExtensionMethodParameter.results.txt +++ b/idea/testData/slicer/outflow/abstractExtensionMethodParameter.results.txt @@ -2,6 +2,7 @@ 4 fun Int.foo(p: Any) 3 public void foo(int receiver, Object p) { 4 System.out.println(p); -9 println(p) // this usage will be shown twice due to bug in Java implementation: https://youtrack.jetbrains.com/issue/IDEA-236958 +9 val v = p // this usage will be shown twice due to bug in Java implementation: https://youtrack.jetbrains.com/issue/IDEA-236958 +9 val v = p // this usage will be shown twice due to bug in Java implementation: https://youtrack.jetbrains.com/issue/IDEA-236958 8 override fun Int.foo(p: Any) { -9 DUPLICATE: println(p) // this usage will be shown twice due to bug in Java implementation: https://youtrack.jetbrains.com/issue/IDEA-236958 +9 DUPLICATE: val v = p // this usage will be shown twice due to bug in Java implementation: https://youtrack.jetbrains.com/issue/IDEA-236958 diff --git a/idea/testData/slicer/outflow/abstractMethodParameter1.kt b/idea/testData/slicer/outflow/abstractMethodParameter1.kt index d5f736ed16e..0a5070f569f 100644 --- a/idea/testData/slicer/outflow/abstractMethodParameter1.kt +++ b/idea/testData/slicer/outflow/abstractMethodParameter1.kt @@ -6,6 +6,6 @@ interface I { class C : I { override fun foo(p: Any) { - println(p) + val v = p } } diff --git a/idea/testData/slicer/outflow/abstractMethodParameter1.results.txt b/idea/testData/slicer/outflow/abstractMethodParameter1.results.txt index 30e7f0a4163..740a8dfcba0 100644 --- a/idea/testData/slicer/outflow/abstractMethodParameter1.results.txt +++ b/idea/testData/slicer/outflow/abstractMethodParameter1.results.txt @@ -1,3 +1,4 @@ 4 fun foo(p: Any) 8 override fun foo(p: Any) { -9 println(p) +9 val v = p +9 val v = p diff --git a/idea/testData/slicer/outflow/abstractMethodParameter2.kt b/idea/testData/slicer/outflow/abstractMethodParameter2.kt index 02fe493c93b..51bda3049a8 100644 --- a/idea/testData/slicer/outflow/abstractMethodParameter2.kt +++ b/idea/testData/slicer/outflow/abstractMethodParameter2.kt @@ -6,7 +6,7 @@ interface I { class C : I { override fun foo(p: Any) { - println(p) // this usage will be shown twice due to bug in Java implementation: https://youtrack.jetbrains.com/issue/IDEA-236958 + val v = p // this usage will be shown twice due to bug in Java implementation: https://youtrack.jetbrains.com/issue/IDEA-236958 } } diff --git a/idea/testData/slicer/outflow/abstractMethodParameter2.results.txt b/idea/testData/slicer/outflow/abstractMethodParameter2.results.txt index b3d12bc7243..1b06742630d 100644 --- a/idea/testData/slicer/outflow/abstractMethodParameter2.results.txt +++ b/idea/testData/slicer/outflow/abstractMethodParameter2.results.txt @@ -2,6 +2,7 @@ 4 fun foo(p: Any) 2 public void foo(Object p) { 3 System.out.println(p); -9 println(p) // this usage will be shown twice due to bug in Java implementation: https://youtrack.jetbrains.com/issue/IDEA-236958 +9 val v = p // this usage will be shown twice due to bug in Java implementation: https://youtrack.jetbrains.com/issue/IDEA-236958 +9 val v = p // this usage will be shown twice due to bug in Java implementation: https://youtrack.jetbrains.com/issue/IDEA-236958 8 override fun foo(p: Any) { -9 DUPLICATE: println(p) // this usage will be shown twice due to bug in Java implementation: https://youtrack.jetbrains.com/issue/IDEA-236958 +9 DUPLICATE: val v = p // this usage will be shown twice due to bug in Java implementation: https://youtrack.jetbrains.com/issue/IDEA-236958 diff --git a/idea/testData/slicer/outflow/diamondHierarchyJKLeafClassFun.kt b/idea/testData/slicer/outflow/diamondHierarchyJKLeafClassFun.kt index e04fbe3caae..5f3e69acd18 100644 --- a/idea/testData/slicer/outflow/diamondHierarchyJKLeafClassFun.kt +++ b/idea/testData/slicer/outflow/diamondHierarchyJKLeafClassFun.kt @@ -1,10 +1,10 @@ // FLOW: OUT -class D : B(), C { +internal class D : B(), C { override fun foo() = 4 } -fun test(a: A, b: B, c: C, d: D) { +internal fun test(a: A, b: B, c: C, d: D) { val x = a.foo() val y = b.foo() val z = c.foo() diff --git a/idea/testData/slicer/outflow/diamondHierarchyJKMiddleClassFun.kt b/idea/testData/slicer/outflow/diamondHierarchyJKMiddleClassFun.kt index be5bd1f39e0..04307f521d6 100644 --- a/idea/testData/slicer/outflow/diamondHierarchyJKMiddleClassFun.kt +++ b/idea/testData/slicer/outflow/diamondHierarchyJKMiddleClassFun.kt @@ -4,7 +4,7 @@ open class B : A { override fun foo() = 2 } -fun test(a: A, b: B, c: C, d: D) { +internal fun test(a: A, b: B, c: C, d: D) { val x = a.foo() val y = b.foo() val z = c.foo() diff --git a/idea/testData/slicer/outflow/diamondHierarchyJKMiddleInterfaceFun.java b/idea/testData/slicer/outflow/diamondHierarchyJKMiddleInterfaceFun.java index 69a9690517c..d95cc7ff3aa 100644 --- a/idea/testData/slicer/outflow/diamondHierarchyJKMiddleInterfaceFun.java +++ b/idea/testData/slicer/outflow/diamondHierarchyJKMiddleInterfaceFun.java @@ -2,7 +2,7 @@ interface A { public int foo(); } -class B extends A { +class B implements A { public int foo() { return 2; } diff --git a/idea/testData/slicer/outflow/diamondHierarchyJKMiddleInterfaceFun.kt b/idea/testData/slicer/outflow/diamondHierarchyJKMiddleInterfaceFun.kt index e5d32556e94..d9b4e480be3 100644 --- a/idea/testData/slicer/outflow/diamondHierarchyJKMiddleInterfaceFun.kt +++ b/idea/testData/slicer/outflow/diamondHierarchyJKMiddleInterfaceFun.kt @@ -1,10 +1,10 @@ // FLOW: OUT -interface C : A { +internal interface C : A { override fun foo() = 3 } -fun test(a: A, b: B, c: C, d: D) { +internal fun test(a: A, b: B, c: C, d: D) { val x = a.foo() val y = b.foo() val z = c.foo() diff --git a/idea/testData/slicer/outflow/extensionIndexingDereferences.kt b/idea/testData/slicer/outflow/extensionIndexingDereferences.kt index aa035f5c241..d8a5ea5453e 100644 --- a/idea/testData/slicer/outflow/extensionIndexingDereferences.kt +++ b/idea/testData/slicer/outflow/extensionIndexingDereferences.kt @@ -5,7 +5,9 @@ class A operator fun A.get(i: Int) = this operator fun A.set(i: Int, a: A) = this -operator fun A.plusAssign(a: A) = this +operator fun A.plusAssign(a: A) { + val v = this +} operator fun A.times(a: A) = this operator fun A.inc() = this diff --git a/idea/testData/slicer/outflow/extensionIndexingDereferences.results.txt b/idea/testData/slicer/outflow/extensionIndexingDereferences.results.txt index 9e9963f3e3d..6497719d948 100644 --- a/idea/testData/slicer/outflow/extensionIndexingDereferences.results.txt +++ b/idea/testData/slicer/outflow/extensionIndexingDereferences.results.txt @@ -1,6 +1,6 @@ -13 val x = A() -16 x[1] -17 x[1] = y -18 x[1] += y -19 x[1] *= y -20 x[1]++ +15 val x = A() +18 x[1] +19 x[1] = y +20 x[1] += y +21 x[1] *= y +22 x[1]++ diff --git a/idea/testData/slicer/outflow/forVariable.kt b/idea/testData/slicer/outflow/forVariable.kt index 58f44de0184..95e1eb91a7e 100644 --- a/idea/testData/slicer/outflow/forVariable.kt +++ b/idea/testData/slicer/outflow/forVariable.kt @@ -4,6 +4,6 @@ fun f1(param: String) {} fun f4(list: List) { for (s in list) - if (s.isNotEmpty()) + if (s.length == 0) f1(s) } \ No newline at end of file diff --git a/idea/testData/slicer/outflow/forVariable.results.txt b/idea/testData/slicer/outflow/forVariable.results.txt index 12d594736ff..a6f8f6aaeb0 100644 --- a/idea/testData/slicer/outflow/forVariable.results.txt +++ b/idea/testData/slicer/outflow/forVariable.results.txt @@ -1,4 +1,4 @@ 6 for (s in list) -7 if (s.isNotEmpty()) +7 if (s.length == 0) 8 f1(s) 3 fun f1(param: String) {} diff --git a/idea/testData/slicer/outflow/indexingDereferences.kt b/idea/testData/slicer/outflow/indexingDereferences.kt index 075a274c1af..6ee611aa8c2 100644 --- a/idea/testData/slicer/outflow/indexingDereferences.kt +++ b/idea/testData/slicer/outflow/indexingDereferences.kt @@ -4,7 +4,9 @@ class A { operator fun get(i: Int) = this operator fun set(i: Int, a: A) = this - operator fun plusAssign(a: A) = this + operator fun plusAssign(a: A) { + val v = a + } operator fun times(a: A) = this operator fun inc() = this } diff --git a/idea/testData/slicer/outflow/indexingDereferences.results.txt b/idea/testData/slicer/outflow/indexingDereferences.results.txt index 4b68a49ff75..3bf4d7e7262 100644 --- a/idea/testData/slicer/outflow/indexingDereferences.results.txt +++ b/idea/testData/slicer/outflow/indexingDereferences.results.txt @@ -1,6 +1,6 @@ -13 val x = A() -16 DEREFERENCE: x[1] -17 DEREFERENCE: x[1] = y -18 DEREFERENCE: x[1] += y -19 DEREFERENCE: x[1] *= y -20 DEREFERENCE: x[1]++ +15 val x = A() +18 DEREFERENCE: x[1] +19 DEREFERENCE: x[1] = y +20 DEREFERENCE: x[1] += y +21 DEREFERENCE: x[1] *= y +22 DEREFERENCE: x[1]++ diff --git a/idea/testData/slicer/outflow/jvmFieldMemberPropertyJavaUsages.kt b/idea/testData/slicer/outflow/jvmFieldMemberPropertyJavaUsages.kt index 93ab1001c7a..6e908f7609b 100644 --- a/idea/testData/slicer/outflow/jvmFieldMemberPropertyJavaUsages.kt +++ b/idea/testData/slicer/outflow/jvmFieldMemberPropertyJavaUsages.kt @@ -1,4 +1,5 @@ // FLOW: OUT +// WITH_RUNTIME class A { @JvmField val x = 1 diff --git a/idea/testData/slicer/outflow/jvmFieldMemberPropertyJavaUsages.results.txt b/idea/testData/slicer/outflow/jvmFieldMemberPropertyJavaUsages.results.txt index 6fb0caa30e6..1e1f69bf987 100644 --- a/idea/testData/slicer/outflow/jvmFieldMemberPropertyJavaUsages.results.txt +++ b/idea/testData/slicer/outflow/jvmFieldMemberPropertyJavaUsages.results.txt @@ -1,3 +1,3 @@ -4 @JvmField val x = 1 +5 @JvmField val x = 1 3 int x = new A().x; 3 int x = new A().x; diff --git a/idea/testData/slicer/outflow/openMethodParameter.kt b/idea/testData/slicer/outflow/openMethodParameter.kt index 3f1cd424bba..c3680c6c31a 100644 --- a/idea/testData/slicer/outflow/openMethodParameter.kt +++ b/idea/testData/slicer/outflow/openMethodParameter.kt @@ -1,13 +1,13 @@ // FLOW: OUT open class C { - open fun foo(p: Any) { - println(p) + open fun foo(p: String) { + val v = p } } class D : C() { - override fun foo(p: Any) { - println(p + 1) + override fun foo(p: String) { + val v = p + 1 } } diff --git a/idea/testData/slicer/outflow/openMethodParameter.results.txt b/idea/testData/slicer/outflow/openMethodParameter.results.txt index 39f622c244b..1cf66fd369b 100644 --- a/idea/testData/slicer/outflow/openMethodParameter.results.txt +++ b/idea/testData/slicer/outflow/openMethodParameter.results.txt @@ -1,4 +1,5 @@ -4 open fun foo(p: Any) { -5 println(p) -10 override fun foo(p: Any) { -11 println(p + 1) +4 open fun foo(p: String) { +5 val v = p +5 val v = p +10 override fun foo(p: String) { +11 val v = p + 1 diff --git a/idea/testData/slicer/outflow/operatorCallDereferences.kt b/idea/testData/slicer/outflow/operatorCallDereferences.kt index 6ca9445300e..86d1f16f725 100644 --- a/idea/testData/slicer/outflow/operatorCallDereferences.kt +++ b/idea/testData/slicer/outflow/operatorCallDereferences.kt @@ -5,13 +5,17 @@ class A { operator fun plus(n: Int) = this operator fun unaryPlus() = this operator fun inc() = this - operator fun timesAssign(n: Int) = this + operator fun timesAssign(n: Int) { + val v = this + } } operator fun A.minus(n: Int) = this operator fun A.unaryMinus() = this operator fun A.dec() = this -operator fun A.divAssign(n: Int) = this +operator fun A.divAssign(n: Int) { + val v = this +} fun test() { var x = A() diff --git a/idea/testData/slicer/outflow/operatorCallDereferences.results.txt b/idea/testData/slicer/outflow/operatorCallDereferences.results.txt index b5ba5cf6261..e5765401183 100644 --- a/idea/testData/slicer/outflow/operatorCallDereferences.results.txt +++ b/idea/testData/slicer/outflow/operatorCallDereferences.results.txt @@ -1,22 +1,22 @@ -17 var x = A() -19 DEREFERENCE: +x -20 DEREFERENCE: x + 1 -21 DEREFERENCE: x++ -22 DEREFERENCE: x += 1 -23 DEREFERENCE: x *= 1 -25 -x -12 operator fun A.unaryMinus() = this -12 operator fun A.unaryMinus() = this -12 operator fun A.unaryMinus() = this -25 -x -26 x - 1 -11 operator fun A.minus(n: Int) = this -11 operator fun A.minus(n: Int) = this -11 operator fun A.minus(n: Int) = this -26 x - 1 -28 x -= 1 -17 DUPLICATE: var x = A() -29 x /= 1 -14 operator fun A.divAssign(n: Int) = this -14 operator fun A.divAssign(n: Int) = this -14 operator fun A.divAssign(n: Int) = this +21 var x = A() +23 DEREFERENCE: +x +24 DEREFERENCE: x + 1 +25 DEREFERENCE: x++ +26 DEREFERENCE: x += 1 +27 DEREFERENCE: x *= 1 +29 -x +14 operator fun A.unaryMinus() = this +14 operator fun A.unaryMinus() = this +14 operator fun A.unaryMinus() = this +29 -x +30 x - 1 +13 operator fun A.minus(n: Int) = this +13 operator fun A.minus(n: Int) = this +13 operator fun A.minus(n: Int) = this +30 x - 1 +32 x -= 1 +21 DUPLICATE: var x = A() +33 x /= 1 +16 operator fun A.divAssign(n: Int) { +17 val v = this +17 val v = this diff --git a/idea/testData/slicer/outflow/overridingFunctionResultWithJava.java b/idea/testData/slicer/outflow/overridingFunctionResultWithJava.java index a27d38dcf2c..d94027e2762 100644 --- a/idea/testData/slicer/outflow/overridingFunctionResultWithJava.java +++ b/idea/testData/slicer/outflow/overridingFunctionResultWithJava.java @@ -1,11 +1,11 @@ class A { - int foo() { + public int foo() { return 1; } } class C extends B { - int foo() { + public int foo() { return 3; } } \ No newline at end of file diff --git a/idea/testData/slicer/outflow/overridingFunctionResultWithJava.kt b/idea/testData/slicer/outflow/overridingFunctionResultWithJava.kt index 8b9a8a5ff08..96cddfe5dec 100644 --- a/idea/testData/slicer/outflow/overridingFunctionResultWithJava.kt +++ b/idea/testData/slicer/outflow/overridingFunctionResultWithJava.kt @@ -1,10 +1,10 @@ // FLOW: OUT -open class B : A() { +internal open class B : A() { override fun foo() = 2 } -fun test(a: A, b: B, c: C) { +internal fun test(a: A, b: B, c: C) { val x = a.foo() val y = b.foo() val z = c.foo() diff --git a/idea/testData/slicer/outflow/overridingFunctionResultWithJava.results.txt b/idea/testData/slicer/outflow/overridingFunctionResultWithJava.results.txt index c8e20eb4566..b9e7c7478f8 100644 --- a/idea/testData/slicer/outflow/overridingFunctionResultWithJava.results.txt +++ b/idea/testData/slicer/outflow/overridingFunctionResultWithJava.results.txt @@ -1,6 +1,6 @@ 4 override fun foo() = 2 4 override fun foo() = 2 -2 int foo() { +2 public int foo() { 8 val x = a.foo() 8 val x = a.foo() 9 val y = b.foo() diff --git a/idea/testData/slicer/outflow/overridingParameter.kt b/idea/testData/slicer/outflow/overridingParameter.kt index bb2325276dc..ec2eb4f57ab 100644 --- a/idea/testData/slicer/outflow/overridingParameter.kt +++ b/idea/testData/slicer/outflow/overridingParameter.kt @@ -6,7 +6,7 @@ open class A() { open class B(override val foo: Int) : A() -class C : B() { +class C : B(1) { override val foo = 3 } diff --git a/idea/testData/slicer/outflow/topLevelPropertyUsages.kt b/idea/testData/slicer/outflow/topLevelPropertyUsages.kt index 4b4415b421b..4738290d1d4 100644 --- a/idea/testData/slicer/outflow/topLevelPropertyUsages.kt +++ b/idea/testData/slicer/outflow/topLevelPropertyUsages.kt @@ -1,4 +1,5 @@ // FLOW: OUT +// WITH_RUNTIME val x = 1 @@ -9,7 +10,7 @@ fun test() { val z: Int - init { + run { z = x bar(x) diff --git a/idea/testData/slicer/outflow/topLevelPropertyUsages.results.txt b/idea/testData/slicer/outflow/topLevelPropertyUsages.results.txt index ec9bcde018a..1356fae101e 100644 --- a/idea/testData/slicer/outflow/topLevelPropertyUsages.results.txt +++ b/idea/testData/slicer/outflow/topLevelPropertyUsages.results.txt @@ -1,10 +1,10 @@ -3 val x = 1 -5 val y = x -5 val y = x +4 val x = 1 3 int x = TopLevelPropertyUsagesKt.getX(); -8 val y = x -8 val y = x -13 z = x -10 val z: Int -15 bar(x) -19 fun bar(m: Int) { +6 val y = x +6 val y = x +9 val y = x +9 val y = x +14 z = x +11 val z: Int +16 bar(x) +20 fun bar(m: Int) { diff --git a/idea/testData/slicer/outflow/usagesInTemplates.kt b/idea/testData/slicer/outflow/usagesInTemplates.kt index 53229fac454..1c5a33e7b39 100644 --- a/idea/testData/slicer/outflow/usagesInTemplates.kt +++ b/idea/testData/slicer/outflow/usagesInTemplates.kt @@ -6,6 +6,6 @@ fun f1(param: String){ fun main(args: Array) { val hello = "Hello" - println("hello = $hello") + val v = "hello = $hello" f1(hello) } \ No newline at end of file diff --git a/idea/testData/slicer/outflow/usagesInTemplates.results.txt b/idea/testData/slicer/outflow/usagesInTemplates.results.txt index 1065639eacb..1dfba865a87 100644 --- a/idea/testData/slicer/outflow/usagesInTemplates.results.txt +++ b/idea/testData/slicer/outflow/usagesInTemplates.results.txt @@ -1,5 +1,5 @@ 8 val hello = "Hello" -9 println("hello = $hello") +9 val v = "hello = $hello" 10 f1(hello) 3 fun f1(param: String){ 4 val a = "param = $param" diff --git a/idea/testData/slicer/outflow/wrongThis.kt b/idea/testData/slicer/outflow/wrongThis.kt index 606e1cb6a64..24fc561d566 100644 --- a/idea/testData/slicer/outflow/wrongThis.kt +++ b/idea/testData/slicer/outflow/wrongThis.kt @@ -1,4 +1,5 @@ // FLOW: OUT +// WITH_RUNTIME class C { fun String.extensionFun(): Any { @@ -13,7 +14,3 @@ class C { val x = "".extensionFun() } } - -inline fun with(receiver: T, block: T.() -> R): R { - return receiver.block() -} diff --git a/idea/testData/slicer/outflow/wrongThis.results.txt b/idea/testData/slicer/outflow/wrongThis.results.txt index f2529851bf8..ed41caf6f59 100644 --- a/idea/testData/slicer/outflow/wrongThis.results.txt +++ b/idea/testData/slicer/outflow/wrongThis.results.txt @@ -1,3 +1,3 @@ -13 val x = "".extensionFun() -4 fun String.extensionFun(): Any { -7 println(this@extensionFun.length) +14 val x = "".extensionFun() +5 fun String.extensionFun(): Any { +8 println(this@extensionFun.length) diff --git a/idea/tests/org/jetbrains/kotlin/idea/slicer/AbstractSlicerTest.kt b/idea/tests/org/jetbrains/kotlin/idea/slicer/AbstractSlicerTest.kt index 674657a744c..5cb218c8ddb 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/slicer/AbstractSlicerTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/slicer/AbstractSlicerTest.kt @@ -26,10 +26,16 @@ abstract class AbstractSlicerTest : KotlinLightCodeInsightFixtureTestCase() { }!! myFixture.testDataPath = "${KotlinTestUtils.getHomeDirectory()}/${rootDir.path}" - - extraFiles.forEach { myFixture.configureByFile(it.name) } + + val extraPsiFiles = extraFiles.map { myFixture.configureByFile(it.name) } val file = myFixture.configureByFile(mainFile.name) as KtFile + // check correctness of test data + extraPsiFiles.forEach { + myFixture.testHighlighting(false, false, false, it.virtualFile) + } + myFixture.testHighlighting(false, false, false, file.virtualFile) + testSliceFromOffset(file, editor.caretModel.offset) { sliceProvider, rootNode -> doTest(path, sliceProvider, rootNode) }