Unit as object

This commit is contained in:
Zalim Bashorov
2014-07-23 18:36:44 +04:00
parent 3c33b7dcfa
commit 4514792104
+11 -5
View File
@@ -16,10 +16,16 @@
package kotlin
public open class Unit internal () {
override fun toString() = "Unit.VALUE"
public class object : Unit() {
public val VALUE: Unit = this: Any as Unit
// Temporary class for backward compatibility with Java code
private open class OldUnit() {
class object {
public val VALUE: Unit = Unit
}
}
public object Unit : OldUnit() {
public val VALUE: Unit
get() = this
override fun toString() = "kotlin.Unit"
}