From 133b2918e1cab09f01dd2a67e5b8e7e87f4ae0fe Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Fri, 25 Jul 2014 21:45:15 +0400 Subject: [PATCH] Drop a hack which allowed to make Unit an object --- compiler/testData/builtin-classes.txt | 20 +------------------- core/builtins/src/kotlin/Unit.kt | 12 +----------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/compiler/testData/builtin-classes.txt b/compiler/testData/builtin-classes.txt index d5a5cdb94ef..0a65eb38e92 100644 --- a/compiler/testData/builtin-classes.txt +++ b/compiler/testData/builtin-classes.txt @@ -1278,16 +1278,6 @@ public abstract class Number { public abstract fun toShort(): kotlin.Short } -private open class OldUnit { - /*primary*/ public constructor OldUnit() - - private class object { - /*primary*/ private constructor () - public final val VALUE: kotlin.Unit - public final fun (): kotlin.Unit - } -} - public trait Progression : kotlin.Iterable { public abstract val end: N public abstract fun (): N @@ -1473,16 +1463,8 @@ public open class Throwable { public final fun printStackTrace(): kotlin.Unit } -public object Unit : kotlin.OldUnit { +public object Unit { /*primary*/ private constructor Unit() - public final val VALUE: kotlin.Unit - public final fun (): kotlin.Unit - - public class object : kotlin.Unit { - /*primary*/ private constructor () - public final override /*1*/ /*fake_override*/ val VALUE: kotlin.Unit - public final override /*1*/ /*fake_override*/ fun (): kotlin.Unit - } } public final annotation class data : kotlin.Annotation { diff --git a/core/builtins/src/kotlin/Unit.kt b/core/builtins/src/kotlin/Unit.kt index 1be6204b0c4..bc5d0988db5 100644 --- a/core/builtins/src/kotlin/Unit.kt +++ b/core/builtins/src/kotlin/Unit.kt @@ -16,16 +16,6 @@ package kotlin -// 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 - +public object Unit { override fun toString() = "kotlin.Unit" }