Fix #7991: don't set JavaDefined for Dotty Enum module class #8008
Fix #7991: don't set JavaDefined for Dotty Enum module class
Top-level Dotty Enum classes have the flag JAVA_ACC_ENUM.
Moving definitions will make Scala code crash at runtime. See `tests/run/i6664b` for an example.
Currently the only way to put initializer inside the static constructor is to use @static. However, CheckStatic restricts that @static can only used in companion object, which is a user-facing check, as MoveStatics can handle @static member in the class. We need a refactoring to make @static a general mechanism that includes a phase to generate the static constructor. This needs to be addressed in another PR.
anatoliykmetyuk left a comment