c591601274
Unfortunately, the same testdata is used in IDE, so we should change
testdata in compiler repo and this will affect IDE repo.
This commit is the cherry-pick of commits from IDE repo:
- 4310d730795a53a Fix UltraLightClassLoadingTestGenerated.testEnums():
check by Java file as ULC produces a different but better result
Yan Zhulanow 3/17/21, 8:57 AM
- fbe3c8ba0841f2d4 Disable comparison test for
UltraLightClassSanityTestGenerated.
testAnnotatedPropertyWithSites() Yan Zhulanow 3/18/21, 1:33 PM
- 8fc53027343b5b53 Ignore known (for ages) broken behaviour
of LC Vladimir Dolzhenko 3/19/21, 11:17 PM
43 lines
805 B
Kotlin
Vendored
43 lines
805 B
Kotlin
Vendored
// CHECK_BY_JAVA_FILE
|
|
|
|
import java.util.function.*
|
|
|
|
enum class Direction {
|
|
NORTH, SOUTH, WEST, EAST
|
|
}
|
|
|
|
enum class Color(val rgb: Int = 5) {
|
|
RED(0xFF0000),
|
|
GREEN(0x00FF00),
|
|
BLUE("0x0000FF");
|
|
|
|
constructor(y: String) : this(y.toInt())
|
|
}
|
|
|
|
enum class ProtocolState {
|
|
WAITING {
|
|
override fun signal() = TALKING
|
|
},
|
|
|
|
TALKING {
|
|
override fun signal() = WAITING
|
|
};
|
|
|
|
abstract fun signal(): ProtocolState
|
|
}
|
|
|
|
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
|
|
}
|