Parameter <-> Receiver Conversion: Support header/impl declarations

#KT-18907 Fixed
This commit is contained in:
Alexey Sedunov
2017-08-09 15:19:12 +03:00
parent d3a9d122e6
commit f80fcc7146
29 changed files with 239 additions and 8 deletions
@@ -0,0 +1,9 @@
// "Convert receiver to parameter" "true"
header class Foo {
fun <caret>String.foo(n: Int)
}
fun Foo.test() {
"1".foo(2)
}
@@ -0,0 +1,9 @@
// "Convert receiver to parameter" "true"
header class Foo {
fun foo(s: String, n: Int)
}
fun Foo.test() {
foo("1", 2)
}
@@ -0,0 +1,9 @@
impl class Foo {
impl fun String.foo(n: Int) {
}
}
fun Foo.test() {
"1".foo(2)
}
@@ -0,0 +1,9 @@
impl class Foo {
impl fun foo(s: String, n: Int) {
}
}
fun Foo.test() {
foo("1", 2)
}
@@ -0,0 +1,9 @@
impl class Foo {
impl fun String.foo(n: Int) {
}
}
fun Foo.test() {
"1".foo(2)
}
@@ -0,0 +1,9 @@
impl class Foo {
impl fun foo(s: String, n: Int) {
}
}
fun Foo.test() {
foo("1", 2)
}