More proper fix for KT-8137/EA-69470: avoiding failed assertion when searching usages of parameter of local class constructor

KT-8137 AE at JetSourceNavigationHelper.convertNamedClassOrObject() on function local class with several constructor parameters

 #KT-8137 fixed
 #EA-69470 fixed
This commit is contained in:
Evgeny Gerashchenko
2015-07-01 20:49:20 +03:00
parent 48a8f53551
commit aa65eb1055
9 changed files with 60 additions and 13 deletions
@@ -6,7 +6,8 @@ public open class Server(private val <caret>foo: String = "foo") {
open fun processRequest() = foo
}
public class ServerEx(): Server() {
override fun processRequest() = "foo" + foo
public class ServerEx(): Server(foo = "!") {
override fun processRequest() = "foo" + foo // this reference is found as a side effect of big use scope of constructor parameter:
// if it was simple property, it wouldn't be found
}
@@ -2,7 +2,7 @@ import server.*;
class Client {
public fun foo() {
println(Server().foo)
println(Server(foo = "!").foo)
ServerEx().processRequest()
}
}
@@ -1 +1,5 @@
Value read (6: 33) open fun processRequest() = foo
[kotlinPrivatePropertyUsages2.0.kt] Named argument (9: 33) public class ServerEx(): Server(foo = "!") {
[kotlinPrivatePropertyUsages2.0.kt] Value read (10: 45) override fun processRequest() = "foo" + foo
[kotlinPrivatePropertyUsages2.0.kt] Value read (6: 33) open fun processRequest() = foo
[kotlinPrivatePropertyUsages2.1.kt] Named argument (5: 24) println(Server(foo = "!").foo)
[kotlinPrivatePropertyUsages2.1.kt] Value read (5: 35) println(Server(foo = "!").foo)
@@ -64,4 +64,9 @@ fun test() {
val tt = A.T()
t.bar(2)
val fff = A.T::bar
class LocalClass(val localClassProperty: Int) {
}
LocalClass(localClassProperty = 1).localClassProperty
}