ChangeFunctionParameterTypeFix for TYPE_MISMATCH error
This commit is contained in:
+5
@@ -0,0 +1,5 @@
|
||||
// "Change parameter 'x' type of function 'bar.foo' to '(String) -> Int'" "true"
|
||||
package bar
|
||||
fun foo(w: Int = 0, x: (String) -> Int, y: Int = 0, z: (Int) -> Int = {42}) {
|
||||
foo(1, {(a: String) -> 42}<caret>, 1)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// "Change parameter 'y' type of function 'foo' to 'String'" "true"
|
||||
fun foo(v: Int, w: Int = 0, x: Int = 0, y: String, z: (Int) -> Int = {42}) {
|
||||
foo(0, 1, y = ""<caret>)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// "Change parameter 'z' type of function 'foo' to '(Int) -> Unit'" "true"
|
||||
fun foo(w: Int = 0, x: Int, y: Int = 0, z: (Int) -> Unit) {
|
||||
foo(0, 1) {<caret>}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Change parameter 'x' type of function 'bar.foo' to '(String) -> Int'" "true"
|
||||
package bar
|
||||
fun foo(w: Int = 0, x: Int, y: Int = 0, z: (Int) -> Int = {42}) {
|
||||
foo(1, {(a: String) -> 42}<caret>, 1)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// "Change parameter 'y' type of function 'foo' to 'String'" "true"
|
||||
fun foo(v: Int, w: Int = 0, x: Int = 0, y: Int, z: (Int) -> Int = {42}) {
|
||||
foo(0, 1, y = ""<caret>)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// "Change parameter 'z' type of function 'foo' to '(Int) -> Unit'" "true"
|
||||
fun foo(w: Int = 0, x: Int, y: Int = 0, z: (Int) -> String) {
|
||||
foo(0, 1) {<caret>}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Change parameter 'z' type of function 'foo' to '(Int) -> String'" "false"
|
||||
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>jet.Int</td></tr><tr><td>Found:</td><td>jet.String</td></tr></table></html>
|
||||
fun foo(y: Int = 0, z: (Int) -> String = {""}) {
|
||||
foo {
|
||||
""<caret>: Int
|
||||
""
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Change parameter 'y' type of function 'foo' to 'Int'" "false"
|
||||
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>jet.Int</td></tr><tr><td>Found:</td><td>jet.String</td></tr></table></html>
|
||||
fun foo(y: Int = 0, z: (Int) -> String = {""}) {
|
||||
foo(""<caret>: Int)
|
||||
}
|
||||
Reference in New Issue
Block a user