proper compilation of enums
This commit is contained in:
@@ -329,6 +329,11 @@ public final class jet.DoubleRange : jet.Range<jet.Double> {
|
||||
public final val EMPTY: jet.DoubleRange
|
||||
}
|
||||
}
|
||||
public abstract class jet.Enum</*0*/ E : jet.Enum<E>> : jet.Any {
|
||||
public final /*constructor*/ fun </*0*/ E : jet.Enum<E>><init>(/*0*/ name: jet.String, /*1*/ ordinal: jet.Int): jet.Enum<E>
|
||||
public final fun name(): jet.String
|
||||
public final fun ordinal(): jet.Int
|
||||
}
|
||||
public abstract class jet.ExtensionFunction0</*0*/ in T : jet.Any?, /*1*/ out R : jet.Any?> : jet.Any {
|
||||
public final /*constructor*/ fun </*0*/ in T : jet.Any?, /*1*/ out R : jet.Any?><init>(): jet.ExtensionFunction0<T, R>
|
||||
public abstract fun T.invoke(): R
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
enum class State {
|
||||
O
|
||||
K
|
||||
}
|
||||
|
||||
fun box() = "${State.O.name()}${State.K.name()}"
|
||||
@@ -0,0 +1,8 @@
|
||||
enum class State {
|
||||
_0
|
||||
_1
|
||||
_2
|
||||
_3
|
||||
}
|
||||
|
||||
fun box() = if(State._0.ordinal()==0 && State._1.ordinal() == 1 && State._2.ordinal() == 2 && State._3.ordinal() == 3) "OK" else "fail"
|
||||
@@ -0,0 +1,6 @@
|
||||
enum class State {
|
||||
O
|
||||
K
|
||||
}
|
||||
|
||||
fun box() = "${State.O}${State.K}"
|
||||
@@ -0,0 +1,11 @@
|
||||
enum class Color {
|
||||
RED
|
||||
BLUE
|
||||
}
|
||||
|
||||
fun box() = if(
|
||||
Color.valueOf("RED") == Color.RED
|
||||
&& Color.valueOf("BLUE") == Color.BLUE
|
||||
&& Color.values()[0] == Color.RED
|
||||
&& Color.values()[1] == Color.BLUE
|
||||
) "OK" else "fail"
|
||||
@@ -8,6 +8,8 @@ trait T {}
|
||||
|
||||
class Br(t : T) : T by t {}
|
||||
|
||||
open enum class E() {}
|
||||
open enum class EN() {
|
||||
A
|
||||
}
|
||||
|
||||
class Test2(e : E) : <!DELEGATION_NOT_TO_TRAIT!>E<!> by e {}
|
||||
class Test2(e : EN) : <!DELEGATION_NOT_TO_TRAIT!>EN<!> by e {}
|
||||
|
||||
@@ -1,19 +1,29 @@
|
||||
namespace test
|
||||
|
||||
internal final enum class test.Test : jet.Any {
|
||||
internal final enum class test.Test : jet.Enum<test.Test> {
|
||||
public final /*constructor*/ fun <init>(/*0*/ a: jet.Int): test.Test
|
||||
public final override /*1*/ fun name(): jet.String
|
||||
public final override /*1*/ fun ordinal(): jet.Int
|
||||
internal final class object test.Test.<class-object-for-Test> {
|
||||
internal final /*constructor*/ fun <init>(): test.Test.<class-object-for-Test>
|
||||
internal final val A: test.Test.<class-object-for-Test>.A
|
||||
internal final val C: test.Test.<class-object-for-Test>.C
|
||||
internal final enum entry test.Test.<class-object-for-Test>.A : test.Test {
|
||||
internal final /*constructor*/ fun <init>(): test.Test.<class-object-for-Test>.A
|
||||
public final override /*1*/ fun name(): jet.String
|
||||
public final override /*1*/ fun ordinal(): jet.Int
|
||||
}
|
||||
internal final enum entry test.Test.<class-object-for-Test>.B : test.Test {
|
||||
public final /*constructor*/ fun <init>(/*0*/ x: jet.Int): test.Test.<class-object-for-Test>.B
|
||||
public final override /*1*/ fun name(): jet.String
|
||||
public final override /*1*/ fun ordinal(): jet.Int
|
||||
}
|
||||
internal final enum entry test.Test.<class-object-for-Test>.C : test.Test {
|
||||
internal final /*constructor*/ fun <init>(): test.Test.<class-object-for-Test>.C
|
||||
public final override /*1*/ fun name(): jet.String
|
||||
public final override /*1*/ fun ordinal(): jet.Int
|
||||
}
|
||||
public final fun valueOf(/*0*/ value: jet.String): test.Test
|
||||
public final fun values(): jet.Array<test.Test>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package test
|
||||
|
||||
public class ClassWithTypePRefSelf<P : java.lang.Enum<P>?>() : java.lang.Object() {
|
||||
public class ClassWithTypePRefSelf<P : jet.Enum<P>?>() : java.lang.Object() {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
namespace test
|
||||
|
||||
public final class test.ClassWithTypePRefSelf</*0*/ P : java.lang.Enum<P>?> : java.lang.Object {
|
||||
public final /*constructor*/ fun </*0*/ P : java.lang.Enum<P>?><init>(): test.ClassWithTypePRefSelf<P>
|
||||
public final class test.ClassWithTypePRefSelf</*0*/ P : jet.Enum<P>?> : java.lang.Object {
|
||||
public final /*constructor*/ fun </*0*/ P : jet.Enum<P>?><init>(): test.ClassWithTypePRefSelf<P>
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ private enum class TheEnum(val rgb : Int) {
|
||||
}
|
||||
|
||||
//package rendererTest defined in root package
|
||||
//private final enum class TheEnum defined in rendererTest
|
||||
//private final enum class TheEnum : jet.Enum<rendererTest.TheEnum> defined in rendererTest
|
||||
//value-parameter val rgb : jet.Int defined in rendererTest.TheEnum.<init>
|
||||
//internal final class VAL1 : rendererTest.TheEnum defined in rendererTest.TheEnum.<class-object-for-TheEnum>
|
||||
//internal final val VAL1 : rendererTest.TheEnum.<class-object-for-TheEnum>.VAL1 defined in rendererTest.TheEnum.<class-object-for-TheEnum>
|
||||
Reference in New Issue
Block a user