Introduce "Add '== true'" quick fix for TYPE_MISMATCH
#KT-39930 Fixed
This commit is contained in:
committed by
Dmitry Gridin
parent
5bf18c09bb
commit
efdeb7b449
@@ -0,0 +1,10 @@
|
||||
// "Add '== true'" "false"
|
||||
// DISABLE-ERRORS
|
||||
class Foo {
|
||||
fun bar() = ""
|
||||
}
|
||||
|
||||
fun test(foo: Foo?) {
|
||||
if (foo?.bar()<caret>) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Add '== true'" "false"
|
||||
// DISABLE-ERRORS
|
||||
// ACTION: Add 'toString()' call
|
||||
// ACTION: Change parameter 's' type of function 'baz' to 'Boolean?'
|
||||
// ACTION: Create function 'baz'
|
||||
class Foo {
|
||||
fun bar() = true
|
||||
}
|
||||
|
||||
fun baz(s: String) {}
|
||||
|
||||
fun test(foo: Foo?) {
|
||||
baz(foo?.bar()<caret>)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Add '== true'" "true"
|
||||
class Foo {
|
||||
fun bar() = true
|
||||
}
|
||||
|
||||
fun test(foo: Foo?) {
|
||||
if (foo?.bar()<caret>) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Add '== true'" "true"
|
||||
class Foo {
|
||||
fun bar() = true
|
||||
}
|
||||
|
||||
fun test(foo: Foo?) {
|
||||
if (foo?.bar() == true) {
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Add '== true'" "true"
|
||||
class Foo {
|
||||
fun bar() = true
|
||||
}
|
||||
|
||||
fun baz(b: Boolean) {}
|
||||
|
||||
fun test(foo: Foo?) {
|
||||
baz(foo?.bar()<caret>)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Add '== true'" "true"
|
||||
class Foo {
|
||||
fun bar() = true
|
||||
}
|
||||
|
||||
fun baz(b: Boolean) {}
|
||||
|
||||
fun test(foo: Foo?) {
|
||||
baz(foo?.bar() == true)
|
||||
}
|
||||
Reference in New Issue
Block a user