Only private constructors for sealed / enum classes #KT-12377 Fixed

Also #KT-8497 Fixed
This commit is contained in:
Mikhail Glukhikh
2016-05-18 17:02:50 +03:00
parent cffdce908e
commit 1a8181bdc4
14 changed files with 132 additions and 27 deletions
@@ -0,0 +1,7 @@
sealed class Sealed <!NON_PRIVATE_CONSTRUCTOR_IN_SEALED!>protected<!> constructor(val x: Int) {
object FIRST : Sealed()
<!NON_PRIVATE_CONSTRUCTOR_IN_SEALED!>public<!> constructor(): this(42)
constructor(y: Int, z: Int): this(y + z)
}
@@ -0,0 +1,19 @@
package
public sealed class Sealed {
public constructor Sealed()
protected constructor Sealed(/*0*/ x: kotlin.Int)
private constructor Sealed(/*0*/ y: kotlin.Int, /*1*/ z: kotlin.Int)
public final val x: kotlin.Int
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public object FIRST : Sealed {
private constructor FIRST()
public final override /*1*/ /*fake_override*/ val x: kotlin.Int
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}