Introduce "double negation" inspection #KT-4748 Fixed

This commit is contained in:
Dimach
2017-07-25 13:08:27 +03:00
committed by Mikhail Glukhikh
parent be0b01a1e6
commit 88fa7c2952
12 changed files with 140 additions and 0 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.inspections.KotlinDoubleNegationInspection
@@ -0,0 +1,3 @@
fun foo() {
val b = !!<caret>"".equals("")
}
@@ -0,0 +1,3 @@
fun foo() {
val b = "".equals("")
}
@@ -0,0 +1,5 @@
// PROBLEM: none
operator fun Int.not() = this * -1
fun foo() {
val c = !!<caret>1
}
@@ -0,0 +1,3 @@
fun foo() {
val b = !(!<caret>true)
}
@@ -0,0 +1,3 @@
fun foo() {
val b = true
}
@@ -0,0 +1,3 @@
fun foo() {
val b = !!<caret>true
}
@@ -0,0 +1,3 @@
fun foo() {
val b = true
}