Rename: Implement conflict analysis for parameters. Qualify property references to avoid shadowing by parameters

#KT-10687 Fixed
(cherry picked from commit 7d6466d)
This commit is contained in:
Alexey Sedunov
2016-06-10 14:24:28 +03:00
parent c9f659e89b
commit b87d8e29e4
9 changed files with 134 additions and 17 deletions
@@ -0,0 +1,11 @@
package test
class Foo {
var foo: Int = 0
var bar: Int = 0
}
fun makeFoo(foo: Int, _bar: Int) = Foo().apply {
this.foo = foo
bar = _bar
}
@@ -0,0 +1,11 @@
package test
class Foo {
var foo: Int = 0
var bar: Int = 0
}
fun makeFoo(/*rename*/_foo: Int, _bar: Int) = Foo().apply {
foo = _foo
bar = _bar
}
@@ -0,0 +1,6 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/test.kt",
"newName": "foo",
"withRuntime": "true"
}
@@ -0,0 +1,5 @@
package test
fun foo(/*rename*/a: Int, b: String) {
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/test.kt",
"newName": "b",
"withRuntime": "true",
"hint": "Parameter 'b' is already declared in function 'foo'"
}