Extend incremental analysis to object declaration

Fixed #KT-37250
This commit is contained in:
Vladimir Dolzhenko
2020-03-04 17:35:45 +01:00
parent ae208f58a4
commit ddba8e7691
10 changed files with 142 additions and 15 deletions
@@ -0,0 +1,10 @@
// OUT_OF_CODE_BLOCK: TRUE
// TYPE: 'Int'
// TODO: changes in private functions is still subject to OOCB
class A {
fun foo(): Int = 12
private fun bar(): <caret> = foo()
}
// SKIP_ANALYZE_CHECK
@@ -0,0 +1,12 @@
// OUT_OF_CODE_BLOCK: TRUE
// as it's a class body not a named function body
class A {
fun foo(): Int = 12
private fun bar(): Int = foo() + <caret>
}
// TYPE: 1
// SKIP_ANALYZE_CHECK
@@ -0,0 +1,9 @@
// OUT_OF_CODE_BLOCK: TRUE
// TYPE: 'Int'
// TODO: changes in private properties is still subject to OOCB
class Test {
val more : Int = 0
private val test : <caret> = 0
}
// SKIP_ANALYZE_CHECK
+8
View File
@@ -0,0 +1,8 @@
// OUT_OF_CODE_BLOCK: FALSE
// ERROR: Unresolved reference: call
object Foo {
fun foo() {
c<caret>ll()
}
}
@@ -0,0 +1,10 @@
// OUT_OF_CODE_BLOCK: TRUE
// TYPE: 'Int'
// TODO: changes in private functions is still subject to OOCB
object A {
fun foo(): Int = 12
private fun bar(): <caret> = foo()
}
// SKIP_ANALYZE_CHECK
@@ -0,0 +1,12 @@
// OUT_OF_CODE_BLOCK: TRUE
// as it's a object body not a named function body
object A {
fun foo(): Int = 12
private fun bar(): Int = foo() + <caret>
}
// TYPE: 1
// SKIP_ANALYZE_CHECK
@@ -0,0 +1,9 @@
// OUT_OF_CODE_BLOCK: TRUE
// TYPE: 'Int'
// TODO: changes in private properties is still subject to OOCB
object Test {
val more : Int = 0
private val test : <caret> = 0
}
// SKIP_ANALYZE_CHECK
@@ -0,0 +1,8 @@
// OUT_OF_CODE_BLOCK: FALSE
// ERROR: Unresolved reference: call
object Foo {
init {
c<caret>ll()
}
}