Introduce "Unused unary operator" inspection
#KT-12073 Fixed
This commit is contained in:
committed by
Dmitry Gridin
parent
158f7f1cd7
commit
74970ddfeb
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user