Skip to content
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

1.4.11 breaks ValueEnums with private constructors #66

Closed
lloydmeta opened this issue Aug 24, 2016 · 1 comment
Closed

1.4.11 breaks ValueEnums with private constructors #66

lloydmeta opened this issue Aug 24, 2016 · 1 comment

Comments

@lloydmeta
Copy link
Owner

As @zifeo pointed out, this used to compile under > 1.4.11 but fails now.

trait CustomEnumEntry extends IntEnumEntry {
  val value: Int
  val name: String
}
trait CustomEnum[T <: CustomEnumEntry] extends IntEnum[T] {
  def apply(name: String): T =
    values.find(_.name == name).get
}
trait CustomEnumComparable[T <: CustomEnumEntry] {
  this: T =>
  def >=(that: T): Boolean =
    this.value >= that.value
}
sealed abstract class TestEnum private (val value: Int, val name: String)
  extends CustomEnumEntry with CustomEnumComparable[TestEnum]
object TestEnum extends CustomEnum[TestEnum] {
  val values = findValues
  case object A extends TestEnum(10, "a")
  case object B extends TestEnum(20, "b")
}
@lloydmeta lloydmeta changed the title 1.4.11 breaks ValueEnums with private constructos 1.4.11 breaks ValueEnums with private constructors Aug 24, 2016
@lloydmeta
Copy link
Owner Author

Fixed by #67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant