Resolve unaryPlus as plus with error.

This commit is contained in:
Stanislav Erokhin
2015-12-17 16:43:44 +03:00
parent 1a6f9b8d1c
commit 7521b89b3e
5 changed files with 49 additions and 27 deletions
@@ -15,7 +15,7 @@ operator fun String.unaryPlus(): Int = 0
fun test() {
requireInt(+ "")
requireInt(+ Example())
requireString(<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>+<!> ExampleDeprecated())
requireString(<!DEPRECATED_UNARY_PLUS_MINUS!>+ ExampleDeprecated()<!>)
}
fun requireInt(n: Int) {}
@@ -26,7 +26,7 @@ class Example2 {
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun minus() = this
fun test() {
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>+<!>this
<!UNRESOLVED_REFERENCE!>-<!>this
<!DEPRECATED_UNARY_PLUS_MINUS!>+this<!>
<!DEPRECATED_UNARY_PLUS_MINUS!>-this<!>
}
}