Do not report "unused receiver" on operator and infix functions

So #KT-16340 Fixed
This commit is contained in:
Mikhail Glukhikh
2017-10-23 19:13:46 +03:00
parent 54990e16c1
commit 149daa173c
6 changed files with 78 additions and 1 deletions
@@ -0,0 +1,14 @@
// PROBLEM: none
class Test(val test: Int) {
fun foo() = test
}
// Receiver unused but still inapplicable (operator!)
operator fun <caret>Test.invoke(x: Int, y: Int) = Test(x + y)
fun main(args: Array<String>) {
val x = Test(0)(1, 2)
x.foo()
}