Move the Foo class in the test files out of the test itself so that it wouldn't have a recursive macro. I'm not sure why it was recursive, but moving the class definition fixed it.
Upgrade to the most recent enumeratum. On 1.7.3 I received the following error, and I believe that changes present in enumeratum https://github.com/lloydmeta/enumeratum/pull/398 solved this error as well since it removed the usage of Flags.Abstract
[error] -- Error: /Users/chrismcdonnell/other/phobos/modules/enumeratum/src/test/scala/phobos/enumeratum/EnumeratumValueTest.scala:16:15
[error] 16 | val values = findValues
[error] | ^^^^^^^^^^
[error] |Exception occurred while executing macro expansion.
[error] |java.lang.AssertionError: Received invalid flags. Expected flags Flags.Abstract to only contain a subset of Flags.Case | Flags.CaseAccessor | Flags.Deferred | Flags.Enum | Flags.Final | Flags.Given | Flags.Implicit | Flags.JavaStatic | Flags.Lazy | Flags.Local | Flags.Module | Flags.Mutable | Flags.Override | Flags.Package | Flags.Param | Flags.ParamAccessor | Flags.Private | Flags.PrivateLocal | Flags.Protected.
[error] | at enumeratum.ValueEnumMacros$.$anonfun$4(ValueEnumMacros.scala:162)
[error] | at scala.Option.getOrElse(Option.scala:201)
[error] | at enumeratum.ValueEnumMacros$.findValueEntriesImpl(ValueEnumMacros.scala:163)
[error] | at enumeratum.ValueEnumMacros$.findIntValueEntriesImpl(ValueEnumMacros.scala:23)
[error] |
[error] |----------------------------------------------------------------------------
[error] |Inline stack trace
[error] |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[error] |This location contains code that was inlined from ValueEnumCompat.scala:23
[error] ----------------------------------------------------------------------------
[error] one error found
Using the
play-json
enumeratum integration as inspiration here, this PR adds an implementation for the various*EnumEntry
types.Things of note I had to do:
-Yretain-trees
compiler option for scala 3 compat as mentioned in the enumeratum READMEFoo
class in the test files out of the test itself so that it wouldn't have a recursive macro. I'm not sure why it was recursive, but moving the class definition fixed it.enumeratum
. On 1.7.3 I received the following error, and I believe that changes present in enumeratum https://github.com/lloydmeta/enumeratum/pull/398 solved this error as well since it removed the usage ofFlags.Abstract