Make changes in super call lambda not cause out-of-block modification (KT-13474)

#KT-13474 Fixed
This commit is contained in:
Nikolay Krasko
2016-08-26 21:17:39 +03:00
parent 64d511566e
commit 52dd02fe08
9 changed files with 77 additions and 7 deletions
@@ -0,0 +1,12 @@
// FALSE
// Navigation from "class B: A()" should move to valid constructor even after changing type in lambda
open class A(l: String) {
constructor(x: Int) : this("$x")
}
fun <T> foo(l: () -> T) = l()
class B: A(foo { "1"<caret> })
@@ -0,0 +1,5 @@
// FALSE
open class A(a: () -> Unit)
class B: A({ "1"<caret> })
@@ -0,0 +1,10 @@
// TRUE
// Can't result to false as there's no body expression, so it's considered to be changes in JavaCodeBlockModificationListener.
open class A(a: () -> Unit) {
constructor(f: (String) -> Unit) : this({ -> f("") })
}
class B: A({ s<caret> -> "1" })
// SKIP_ANALYZE_CHECK