Do not include overriders when analyzing parameter usages unless invoked on parameter

This commit is contained in:
Valentin Kipyatkov
2020-02-10 08:02:14 +02:00
parent e76eaa4b5b
commit ff516cac73
12 changed files with 118 additions and 6 deletions
+28
View File
@@ -0,0 +1,28 @@
// FLOW: IN
open class C {
var other: C? = null
fun foo(p: Int) {
println(p + 1)
other?.bar(p + 1)
}
fun bar(p: Int) {
println(<caret>p + 2)
}
}
class D : C() {
var other: D? = null
override fun foo(p: Int) {
println(p + 3)
other?.bar(p + 3)
}
override fun bar(p: Int) {
println(p + 4)
}
}
+5
View File
@@ -0,0 +1,5 @@
8 other?.bar(<bold>p + 1</bold>)
12 println(<bold>p</bold> + 2)
11 fun bar(<bold>p: Int</bold>) {
8 other?.bar(<bold>p + 1</bold>)
@@ -0,0 +1,4 @@
[NotNull Values]
12 println(<bold>p</bold> + 2)
12 println(<bold>p</bold> + 2)
+3
View File
@@ -0,0 +1,3 @@
12 println(<bold>p</bold> + 2)
11 fun bar(<bold>p: Int</bold>) {
8 other?.bar(<bold>p + 1</bold>)
+28
View File
@@ -0,0 +1,28 @@
// FLOW: IN
open class C {
var other: C? = null
fun foo(p: Int) {
println(p + 1)
other?.bar(p + 1)
}
fun bar(<caret>p: Int) {
println(p + 2)
}
}
class D : C() {
var other: D? = null
override fun foo(p: Int) {
println(p + 3)
other?.bar(p + 3)
}
override fun bar(p: Int) {
println(p + 4)
}
}
@@ -0,0 +1,7 @@
8 other?.bar(<bold>p + 1</bold>)
11 fun bar(<bold>p: Int</bold>) {
8 other?.bar(<bold>p + 1</bold>)
21 other?.bar(<bold>p + 3</bold>)
11 fun bar(<bold>p: Int</bold>) {
21 other?.bar(<bold>p + 3</bold>)
@@ -0,0 +1,3 @@
[NotNull Values]
11 fun bar(<bold>p: Int</bold>) {
11 fun bar(<bold>p: Int</bold>) {
@@ -0,0 +1,3 @@
11 fun bar(<bold>p: Int</bold>) {
8 other?.bar(<bold>p + 1</bold>)
21 other?.bar(<bold>p + 3</bold>)