-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ValueEnum] When using inheritance, Compile error: not all of the members have a literal/constant 'value:String' declaration #294
Comments
Ugh, I think the reason this is happening is because we need to check for As workaround, maybe something like this might help import enumeratum.values.{ StringEnum, StringEnumEntry }
import scala.collection.immutable
sealed abstract class Day extends StringEnumEntry with Product with Serializable
object Day extends StringEnum[Day] {
sealed abstract class Weekend(val value: String) extends Day
sealed abstract class Workday(val value: String) extends Day
val values: immutable.IndexedSeq[Day] = Weekend.values ++ Workday.values
final object Weekend extends StringEnum[Weekend] {
final case object Sun extends Weekend("Sun")
final case object Sat extends Weekend("Sat")
val values: immutable.IndexedSeq[Weekend] = findValues
}
final object Workday extends StringEnum[Workday] {
final case object Mon extends Workday("Mon")
final case object Tue extends Workday("Tue")
final case object Wed extends Workday("Wed")
final case object Thu extends Workday("Thu")
final case object Fri extends Workday("Fri")
val values: immutable.IndexedSeq[Workday] = findValues
}
} |
Version:
1.6.1
The text was updated successfully, but these errors were encountered: