Underscore names are now forbidden

This commit is contained in:
Mikhail Glukhikh
2015-10-19 11:55:59 +03:00
parent f61aa18a05
commit 8d88109c00
8 changed files with 18 additions and 18 deletions
+3 -3
View File
@@ -4,9 +4,9 @@ public open class Identifier() {
private var myNullable : Boolean = true
companion object {
open public fun init(isNullable : Boolean) : Identifier {
val __ = Identifier()
__.myNullable = isNullable
return __
val id = Identifier()
id.myNullable = isNullable
return id
}
}
}
+2 -2
View File
@@ -5,8 +5,8 @@ class Identifier<T>(t : T?, myHasDollar : Boolean) {
companion object {
open public fun <T> init(name : T?) : Identifier<T> {
val __ = Identifier<T>(name, false)
return __
val id = Identifier<T>(name, false)
return id
}
}
init {
+8 -8
View File
@@ -1,20 +1,20 @@
// !DIAGNOSTICS: -DEPRECATION
<!UNDERSCORE_IS_DEPRECATED!>import kotlin.Deprecated as ___<!>
<!UNDERSCORE_IS_RESERVED!>import kotlin.Deprecated as ___<!>
@___("") data class Pair(val x: Int, val y: Int)
class <!UNDERSCORE_IS_DEPRECATED!>_<!><<!UNDERSCORE_IS_DEPRECATED!>________<!>>
val <!UNDERSCORE_IS_DEPRECATED!>______<!> = _<Int>()
class <!UNDERSCORE_IS_RESERVED!>_<!><<!UNDERSCORE_IS_RESERVED!>________<!>>
val <!UNDERSCORE_IS_RESERVED!>______<!> = _<Int>()
fun <!UNDERSCORE_IS_DEPRECATED!>__<!>(<!UNDERSCORE_IS_DEPRECATED!>___<!>: Int, y: _<Int>?): Int {
val (x, <!UNDERSCORE_IS_DEPRECATED!>__________<!>) = Pair(___ - 1, 42)
val <!UNDERSCORE_IS_DEPRECATED!>____<!> = x
fun <!UNDERSCORE_IS_RESERVED!>__<!>(<!UNDERSCORE_IS_RESERVED!>___<!>: Int, y: _<Int>?): Int {
val (x, <!UNDERSCORE_IS_RESERVED!>__________<!>) = Pair(___ - 1, 42)
val <!UNDERSCORE_IS_RESERVED!>____<!> = x
// in backquotes: allowed
val `_` = __________
<!UNDERSCORE_IS_DEPRECATED!>__<!>@ return if (y != null) __(____, y) else __(`_`, ______)
<!UNDERSCORE_IS_RESERVED!>__<!>@ return if (y != null) __(____, y) else __(`_`, ______)
}
fun doIt(f: (Any?) -> Any?) = f(null)
val something = doIt { <!UNDERSCORE_IS_DEPRECATED!>__<!> -> __ }
val something = doIt { <!UNDERSCORE_IS_RESERVED!>__<!> -> __ }