mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Forbid underscore-only (_, __, ___, ...) names as callees and as types. If CHECK_TYPE directive is on, filter out UNDERSCORE_USAGE_WITHOUT_BACKTICKS messages.
15 lines
244 B
Kotlin
Vendored
15 lines
244 B
Kotlin
Vendored
class A {
|
|
operator fun component1() = 1
|
|
operator fun component2() = 2
|
|
}
|
|
|
|
fun box() : String {
|
|
val (_, b) = A()
|
|
|
|
val (a, _) = A()
|
|
|
|
val (`_`, c) = A()
|
|
|
|
return if (a == 1 && b == 2 && `_` == 1 && c == 2) "OK" else "fail"
|
|
}
|