Names containing only '_' are deprecated (declarations, parameters, import aliases, labels, but not backquoted names)

This commit is contained in:
Mikhail Glukhikh
2015-09-25 14:51:00 +03:00
parent ebfb6c8468
commit 0a0bfdacb1
12 changed files with 130 additions and 10 deletions
+16
View File
@@ -0,0 +1,16 @@
// !DIAGNOSTICS: -DEPRECATED_SYMBOL_WITH_MESSAGE
<!UNDESCORE_IS_DEPRECATED!>import kotlin.Deprecated as ___<!>
@___("") data class Pair(val x: Int, val y: Int)
class <!UNDESCORE_IS_DEPRECATED!>_<!><<!UNDESCORE_IS_DEPRECATED!>________<!>>
val <!UNDESCORE_IS_DEPRECATED!>______<!> = _<Int>()
fun <!UNDESCORE_IS_DEPRECATED!>__<!>(<!UNDESCORE_IS_DEPRECATED!>___<!>: Int, y: _<Int>?): Int {
val (x, <!UNDESCORE_IS_DEPRECATED!>__________<!>) = Pair(___ - 1, 42)
val <!UNDESCORE_IS_DEPRECATED!>____<!> = x
// in backquotes: allowed
val `_` = __________
<!UNDESCORE_IS_DEPRECATED!>__<!>@ return if (y != null) __(____, y) else __(`_`, ______)
}