KT-16264 Forbid usage of _ without backticks

Forbid underscore-only (_, __, ___, ...) names as callees and as types.

If CHECK_TYPE directive is on, filter out UNDERSCORE_USAGE_WITHOUT_BACKTICKS messages.
This commit is contained in:
Dmitry Petrov
2017-03-28 17:15:23 +03:00
parent 0a3c031528
commit caae6ff2ec
22 changed files with 317 additions and 19 deletions
@@ -38,11 +38,11 @@ fun test() {
val (<!REDECLARATION!>`_`<!>, z) = A()
foo(_, z)
foo(<!UNDERSCORE_USAGE_WITHOUT_BACKTICKS!>_<!>, z)
val (_, <!NAME_SHADOWING, REDECLARATION!>`_`<!>) = A()
foo(<!TYPE_MISMATCH!>_<!>, y)
foo(<!UNDERSCORE_USAGE_WITHOUT_BACKTICKS, TYPE_MISMATCH!>_<!>, y)
val (<!UNUSED_VARIABLE!>unused<!>, _) = A()
}