add ultra-light classes/members that work without backend in simple cases
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
|
||||
import java.util.function.*
|
||||
|
||||
/** should load cls */
|
||||
enum class Direction {
|
||||
NORTH, SOUTH, WEST, EAST
|
||||
}
|
||||
|
||||
/** should load cls */
|
||||
enum class Color(val rgb: Int) {
|
||||
RED(0xFF0000),
|
||||
GREEN(0x00FF00),
|
||||
BLUE(0x0000FF)
|
||||
}
|
||||
|
||||
/** should load cls */
|
||||
enum class ProtocolState {
|
||||
WAITING {
|
||||
override fun signal() = TALKING
|
||||
},
|
||||
|
||||
TALKING {
|
||||
override fun signal() = WAITING
|
||||
};
|
||||
|
||||
abstract fun signal(): ProtocolState
|
||||
}
|
||||
|
||||
/** should load cls */
|
||||
enum class IntArithmetics : BinaryOperator<Int>, IntBinaryOperator {
|
||||
PLUS {
|
||||
override fun apply(t: Int, u: Int): Int = t + u
|
||||
},
|
||||
TIMES {
|
||||
override fun apply(t: Int, u: Int): Int = t * u
|
||||
};
|
||||
|
||||
override fun applyAsInt(t: Int, u: Int) = apply(t, u)
|
||||
}
|
||||
|
||||
class C {
|
||||
val enumConst: Direction? = Direction.EAST
|
||||
}
|
||||
Reference in New Issue
Block a user