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:
+11
@@ -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
|
||||
}
|
||||
+11
@@ -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
|
||||
}
|
||||
Vendored
+6
@@ -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) {
|
||||
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"type": "MARKED_ELEMENT",
|
||||
"mainFile": "test/test.kt",
|
||||
"newName": "b",
|
||||
"withRuntime": "true",
|
||||
"hint": "Parameter 'b' is already declared in function 'foo'"
|
||||
}
|
||||
Reference in New Issue
Block a user