I have the following Kotlin enum class:
enum class DurationModifier {
GreaterThan {
override val displayName = "≥"
},
LessThan {
override val displayName = "≤"
};
abstract val displayName: String
}
It has been part of my project for a long time and has been compiling just fine. This compiles just fine using IntelliJ or Android Studio, but when I run the gradle build manually from the command line (./gradlew assembleDebug
) I get this:
e: {projectDir}/build/tmp/kapt3/stubs/{package}/search/DurationModifier.java:17: error: invalid method declaration; return type required
DurationModifier() {
^
I've completely cleaned everything I can think of (build directories, gradle cache, etc).
I've made lots of changes recently, but since everything has been working fine from the IDE I have no clue what might have caused this. What is wrong here? Why does this work in the IDE but not from the command line?
enum class DurationModifier(val displayName: String){ GreaterThan("≥"), LessThan("≤") }
. – Walkin