Make changes in super call lambda not cause out-of-block modification (KT-13474)
#KT-13474 Fixed
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user