Add Boolean? == const to elvis conversion and vice versa #KT-15368 Fixed
Convert elvis to equality check implemented as inspection due code style guide
This commit is contained in:
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.NullableBooleanElvisInspection
|
||||
@@ -0,0 +1,6 @@
|
||||
fun foo() {
|
||||
var a: Boolean? = null
|
||||
if (a <caret>?: false) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fun foo() {
|
||||
var a: Boolean? = null
|
||||
if (a == true) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fun foo() {
|
||||
var a: Boolean? = null
|
||||
if (!(a <caret>?: false)) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fun foo() {
|
||||
var a: Boolean? = null
|
||||
if (a != true) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
var a: Boolean? = null
|
||||
var b: Boolean? = null
|
||||
if (a ?: false || !(b<caret> ?: true)) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
var a: Boolean? = null
|
||||
var b: Boolean? = null
|
||||
if (a ?: false || b == false) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
fun foo() {
|
||||
var a: Boolean? = null
|
||||
val x = a<caret> ?: false
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
fun foo() {
|
||||
var a: Boolean? = null
|
||||
val x = a == true
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
fun foo() {
|
||||
var b: Boolean? = null
|
||||
val x = !(b <caret>?: true)
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
fun foo() {
|
||||
var b: Boolean? = null
|
||||
val x = b == false
|
||||
}
|
||||
Reference in New Issue
Block a user