Introduce "Unused unary operator" inspection

#KT-12073 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-09-10 11:10:32 +09:00
committed by Dmitry Gridin
parent 158f7f1cd7
commit 74970ddfeb
12 changed files with 153 additions and 0 deletions
@@ -0,0 +1,11 @@
// PROBLEM: none
data class Point(val x: Int)
operator fun Point.plus(other: Point) = Point(this.x + other.x)
operator fun Point.unaryMinus() = Point(-x)
fun test() {
val p = Point(1) + Point(2)
<caret>-Point(3)
}