Refactorings: Support header/impl functions in member hierarchy transformations
#KT-18904 Fixed #KT-18905 Fixed
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
// "Convert '(Int) -> Int' to 'Int.() -> Int'" "true"
|
||||
|
||||
header fun foo(n: Int, action: (<caret>Int) -> Int): Int
|
||||
|
||||
fun test() {
|
||||
foo(1) { n -> n + 1 }
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// "Convert '(Int) -> Int' to 'Int.() -> Int'" "true"
|
||||
|
||||
header fun foo(n: Int, action: Int.() -> Int): Int
|
||||
|
||||
fun test() {
|
||||
foo(1) { this + 1 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
impl fun foo(n: Int, action: (Int) -> Int) = action(n)
|
||||
|
||||
fun test() {
|
||||
foo(1) { n -> n + 1 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
impl fun foo(n: Int, action: Int.() -> Int) = n.action()
|
||||
|
||||
fun test() {
|
||||
foo(1) { this + 1 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
impl fun foo(n: Int, action: (Int) -> Int) = action(n)
|
||||
|
||||
fun test() {
|
||||
foo(1) { n -> n + 1 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
impl fun foo(n: Int, action: Int.() -> Int) = n.action()
|
||||
|
||||
fun test() {
|
||||
foo(1) { this + 1 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
header fun foo(n: Int, action: (Int) -> Int): Int
|
||||
|
||||
fun test() {
|
||||
foo(1) { n -> n + 1 }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
header fun foo(n: Int, action: Int.() -> Int): Int
|
||||
|
||||
fun test() {
|
||||
foo(1) { this + 1 }
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Convert '(Int) -> Int' to 'Int.() -> Int'" "true"
|
||||
|
||||
impl fun foo(n: Int, action: (<caret>Int) -> Int) = action(n)
|
||||
|
||||
fun test() {
|
||||
foo(1) { n -> n + 1 }
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Convert '(Int) -> Int' to 'Int.() -> Int'" "true"
|
||||
|
||||
impl fun foo(n: Int, action: Int.() -> Int) = n.action()
|
||||
|
||||
fun test() {
|
||||
foo(1) { this + 1 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
impl fun foo(n: Int, action: (Int) -> Int) = action(n)
|
||||
|
||||
fun test() {
|
||||
foo(1) { n -> n + 1 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
impl fun foo(n: Int, action: Int.() -> Int) = n.action()
|
||||
|
||||
fun test() {
|
||||
foo(1) { this + 1 }
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Convert 'Int.() -> Int' to '(Int) -> Int'" "true"
|
||||
|
||||
header fun foo(n: Int, action: <caret>Int.() -> Int): Int
|
||||
|
||||
fun test() {
|
||||
foo(1) { this + 1 }
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// "Convert 'Int.() -> Int' to '(Int) -> Int'" "true"
|
||||
|
||||
header fun foo(n: Int, action: (Int) -> Int): Int
|
||||
|
||||
fun test() {
|
||||
foo(1) { i -> i + 1 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
impl fun foo(n: Int, action: Int.() -> Int) = n.action()
|
||||
|
||||
fun test() {
|
||||
foo(1) { this + 1 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
impl fun foo(n: Int, action: (Int) -> Int) = action(n)
|
||||
|
||||
fun test() {
|
||||
foo(1) { i -> i + 1 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
impl fun foo(n: Int, action: Int.() -> Int) = n.action()
|
||||
|
||||
fun test() {
|
||||
foo(1) { this + 1 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
impl fun foo(n: Int, action: (Int) -> Int) = action(n)
|
||||
|
||||
fun test() {
|
||||
foo(1) { i -> i + 1 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
header fun foo(n: Int, action: Int.() -> Int): Int
|
||||
|
||||
fun test() {
|
||||
foo(1) { this + 1 }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
header fun foo(n: Int, action: (Int) -> Int): Int
|
||||
|
||||
fun test() {
|
||||
foo(1) { i -> i + 1 }
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Convert 'Int.() -> Int' to '(Int) -> Int'" "true"
|
||||
|
||||
impl fun foo(n: Int, action: <caret>Int.() -> Int) = n.action()
|
||||
|
||||
fun test() {
|
||||
foo(1) { this + 1 }
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Convert 'Int.() -> Int' to '(Int) -> Int'" "true"
|
||||
|
||||
impl fun foo(n: Int, action: (Int) -> Int) = action(n)
|
||||
|
||||
fun test() {
|
||||
foo(1) { i -> i + 1 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
impl fun foo(n: Int, action: Int.() -> Int) = n.action()
|
||||
|
||||
fun test() {
|
||||
foo(1) { this + 1 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
impl fun foo(n: Int, action: (Int) -> Int) = action(n)
|
||||
|
||||
fun test() {
|
||||
foo(1) { i -> i + 1 }
|
||||
}
|
||||
Reference in New Issue
Block a user