"Add parameter to function" quick fix: apply for TYPE_MISMATCH error

#KT-8478 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-09-07 15:44:25 +09:00
committed by Dmitry Gridin
parent 636f5da883
commit 60f4ed914a
13 changed files with 189 additions and 15 deletions
@@ -0,0 +1,8 @@
// "Add 1st parameter to function 'foo'" "true"
// DISABLE-ERRORS
fun foo(i1: Int, i2: Int, i3: Int, i4: Int) {
}
fun test() {
foo(<caret>"", 2, 3, 4, 5)
}
@@ -0,0 +1,8 @@
// "Add 1st parameter to function 'foo'" "true"
// DISABLE-ERRORS
fun foo(i11: String, i1: Int, i2: Int, i3: Int, i4: Int) {
}
fun test() {
foo(<caret>"", 2, 3, 4, 5)
}
@@ -0,0 +1,8 @@
// "Add 2nd parameter to function 'foo'" "true"
// DISABLE-ERRORS
fun foo(i1: Int, i2: Int, i3: Int, i4: Int) {
}
fun test() {
foo(1, <caret>"", 3, 4, 5)
}
@@ -0,0 +1,8 @@
// "Add 2nd parameter to function 'foo'" "true"
// DISABLE-ERRORS
fun foo(i1: Int, i21: String, i2: Int, i3: Int, i4: Int) {
}
fun test() {
foo(1, <caret>"", 3, 4, 5)
}
@@ -0,0 +1,8 @@
// "Add 3rd parameter to function 'foo'" "true"
// DISABLE-ERRORS
fun foo(i1: Int, i2: Int, i3: Int, i4: Int) {
}
fun test() {
foo(1, 2, <caret>"", 4, 5)
}
@@ -0,0 +1,8 @@
// "Add 3rd parameter to function 'foo'" "true"
// DISABLE-ERRORS
fun foo(i1: Int, i2: Int, i31: String, i3: Int, i4: Int) {
}
fun test() {
foo(1, 2, <caret>"", 4, 5)
}
@@ -0,0 +1,8 @@
// "Add 4th parameter to function 'foo'" "true"
// DISABLE-ERRORS
fun foo(i1: Int, i2: Int, i3: Int, i4: Int) {
}
fun test() {
foo(1, 2, 3, <caret>"", 5)
}
@@ -0,0 +1,8 @@
// "Add 4th parameter to function 'foo'" "true"
// DISABLE-ERRORS
fun foo(i1: Int, i2: Int, i3: Int, i41: String, i4: Int) {
}
fun test() {
foo(1, 2, 3, <caret>"", 5)
}
@@ -0,0 +1,13 @@
// "Add 1st parameter to function 'foo'" "false"
// ACTION: Change parameter 'i1' type of function 'foo' to 'String'
// ACTION: Create function 'foo'
// ACTION: Do not show hints for current method
// ACTION: Put arguments on separate lines
// ACTION: To raw string literal
// DISABLE-ERRORS
fun foo(i1: Int, i2: Int, i3: Int, i4: Int) {
}
fun test() {
foo(<caret>"", "", 3, 4, 5)
}