Get rid of obsolete syntax in quickfixes changing lambda's signature
- Do not wrap parameters with '()' - Do not set return type for them - Fix existing testData
This commit is contained in:
@@ -2,5 +2,5 @@
|
||||
// DISABLE-ERRORS
|
||||
|
||||
fun f(x: Int, y: Int, z : () -> Int) {
|
||||
f(1, 2, {(x: Int, y: Int<caret>) -> x});
|
||||
f(1, 2, {x: Int, y: Int<caret> -> x});
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
// DISABLE-ERRORS
|
||||
|
||||
fun f(x: Int, y: Int, z : (Int, Int?, Any) -> Int) {
|
||||
f(1, 2, {(<caret>x: Int) -> x});
|
||||
f(1, 2, {<caret>x: Int -> x});
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
// DISABLE-ERRORS
|
||||
|
||||
fun f(x: Int, y: Int, z : (Int, Int?, Any) -> Int) {
|
||||
f(1, 2, {(i: Int, i1: Int?, any: Any) -> x});
|
||||
f(1, 2, { i: Int, i1: Int?, any: Any -> x});
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@ fun foo(f: Int.(Int, Int) -> Int) {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
foo { <caret>(a: Int) -> 0 }
|
||||
foo { <caret>a: Int -> 0 }
|
||||
}
|
||||
+1
-1
@@ -5,5 +5,5 @@ fun foo(f: Int.(Int, Int) -> Int) {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
foo {(i: Int, i1: Int) -> 0 }
|
||||
foo { i: Int, i1: Int -> 0 }
|
||||
}
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
// DISABLE-ERRORS
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
Test<String>().perform("") {(s: String?, s1: String?) -> }
|
||||
Test<String>().perform("") { s: String?, s1: String? -> }
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Change type from 'String' to '(Int) -> String'" "true"
|
||||
fun foo(f: ((Int) -> String) -> String) {
|
||||
foo {
|
||||
(f: String<caret>) -> f(42)
|
||||
f: String<caret> -> f(42)
|
||||
}
|
||||
}
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Change type from 'String' to '(Int) -> String'" "true"
|
||||
fun foo(f: ((Int) -> String) -> String) {
|
||||
foo {
|
||||
(f: (Int) -> String<caret>) -> f(42)
|
||||
f: (Int) -> String<caret> -> f(42)
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,6 +2,6 @@
|
||||
|
||||
fun foo(f: ((java.util.LinkedHashSet<Int>) -> java.util.HashSet<Int>) -> String) {
|
||||
foo {
|
||||
(f: String<caret>) -> "42"
|
||||
f: String<caret> -> "42"
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -5,6 +5,6 @@ import java.util.LinkedHashSet
|
||||
|
||||
fun foo(f: ((java.util.LinkedHashSet<Int>) -> java.util.HashSet<Int>) -> String) {
|
||||
foo {
|
||||
(f: (LinkedHashSet<Int>) -> HashSet<Int>) -> "42"
|
||||
f: (LinkedHashSet<Int>) -> HashSet<Int> -> "42"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Change type from 'String' to 'Int'" "true"
|
||||
fun foo(f: (Int) -> String) {
|
||||
foo {
|
||||
(x: String<caret>) -> ""
|
||||
x: String<caret> -> ""
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Change type from 'String' to 'Int'" "true"
|
||||
fun foo(f: (Int) -> String) {
|
||||
foo {
|
||||
(x: Int) -> ""
|
||||
x: Int -> ""
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,6 +2,6 @@
|
||||
|
||||
fun foo(f: (java.util.HashSet<Int>) -> String) {
|
||||
foo {
|
||||
(x: String<caret>) -> ""
|
||||
x: String<caret> -> ""
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,6 +4,6 @@ import java.util.HashSet
|
||||
|
||||
fun foo(f: (java.util.HashSet<Int>) -> String) {
|
||||
foo {
|
||||
(x: HashSet<Int>) -> ""
|
||||
x: HashSet<Int> -> ""
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Change 'f' type to '(Long) -> Unit'" "true"
|
||||
fun foo() {
|
||||
var f: Int = if (true) { (x: Long) -> }<caret> else { (x: Long) -> }
|
||||
var f: Int = if (true) { x: Long -> }<caret> else { x: Long -> }
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Change 'f' type to '(Long) -> Unit'" "true"
|
||||
fun foo() {
|
||||
var f: (Long) -> Unit = if (true) { (x: Long) -> }<caret> else { (x: Long) -> }
|
||||
var f: (Long) -> Unit = if (true) { x: Long -> }<caret> else { x: Long -> }
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// "Change 'f' type to '(Delegates) -> Unit'" "true"
|
||||
|
||||
fun foo() {
|
||||
var f: Int = { (x: kotlin.properties.Delegates) -> }<caret>
|
||||
var f: Int = { x: kotlin.properties.Delegates -> }<caret>
|
||||
}
|
||||
+1
-1
@@ -3,5 +3,5 @@ import kotlin.properties.Delegates
|
||||
// "Change 'f' type to '(Delegates) -> Unit'" "true"
|
||||
|
||||
fun foo() {
|
||||
var f: (Delegates) -> Unit = { (x: kotlin.properties.Delegates) -> }
|
||||
var f: (Delegates) -> Unit = { x: kotlin.properties.Delegates -> }
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Change 'foo' function return type to '(Long) -> Int'" "true"
|
||||
fun foo(x: Any): Int {
|
||||
return {(x: Long) -> 42}<caret>
|
||||
return {x: Long -> 42}<caret>
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Change 'foo' function return type to '(Long) -> Int'" "true"
|
||||
fun foo(x: Any): (Long) -> Int {
|
||||
return {(x: Long) -> 42}<caret>
|
||||
return {x: Long -> 42}<caret>
|
||||
}
|
||||
+1
-1
@@ -8,5 +8,5 @@
|
||||
// ERROR: Unresolved reference: NoSuchType
|
||||
|
||||
fun foo(): Int {
|
||||
return { (x: NoSuchType<caret>) -> 42 }
|
||||
return { x: NoSuchType<caret> -> 42 }
|
||||
}
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// "Change 'f' type to '(Int, Int) -> (String) -> Int'" "true"
|
||||
fun foo() {
|
||||
val f: () -> Long = {
|
||||
(a: Int, b: Int): Long ->
|
||||
val x = {(s: String) -> 42}
|
||||
a: Int, b: Int ->
|
||||
val x = {s: String -> 42}
|
||||
if (true) x
|
||||
else if (true) x else {
|
||||
var y = 42
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// "Change 'f' type to '(Int, Int) -> (String) -> Int'" "true"
|
||||
fun foo() {
|
||||
val f: (Int, Int) -> (String) -> Int = {
|
||||
(a: Int, b: Int): (String) -> Int ->
|
||||
val x = {(s: String) -> 42}
|
||||
a: Int, b: Int ->
|
||||
val x = {s: String -> 42}
|
||||
if (true) x
|
||||
else if (true) x else {
|
||||
var y = 42
|
||||
|
||||
Reference in New Issue
Block a user