E094: Enum Case Definition In Non-Enum Owner

This error was removed before Scala 3.0.0 was released and was never emitted by the Scala 3 compiler. This error was triggered when trying to define enum cases outside of an enum class companion object in early enum implementations.

Example

object Qux {
  case Foo
}

Error

-- Error: example.scala:2:2 ----------------------------------------------------
2 |  case Foo
  |  ^^^^^^^^
  |case not allowed here, since owner object Qux is not an enum object

Explanation

In early versions of Dotty (before Scala 3.0.0), enum cases were only allowed within the companion object of an enum class. The compiler would check that the owner of a case definition was a module class and that its linked class derived from scala.runtime.EnumClass. This restriction was part of an earlier enum implementation scheme that was replaced with a new enum design in commit e1470f488b (February 2018). The new design changed how enum cases are validated and desugared, making this error obsolete. Since Scala 3.0.0, enums use a different validation mechanism that doesn't rely on this specific error.