On the topic of the previously mentioned EnumValueSet, just a reminder that Enumeration.ValueSet is already part of the stdlib ![]()
![]()
Aha thanks! How to use it? (Canāt find examples in doc)
right but its for the old scala.Enumeration
Even within the domain of āold Enumerationā, ValueSet had problems (with inference).
Oh, maybe that was fixed in 2.13.
In any case, it may explain a judicious lack of documentation.
Aha! Thanks. I had forgotten (or repressed) that thing. So I guess @JD557 meant that there is precedence for (supposed to be) āniceā values ā¦
Yes, sorry. Thatās what I meant (not that you could use this to solve your issue).
So why did Scala 3 give up on a very sensible concept and proper domain modeling and instead decided to went back to stone age and just spits out a useless Java array?
This old ValueSet* implementation had even one of the features that are imho super important: You could get BitSets out of enum values! Thatās vital for native interop (with languages like C++).
* I knew that Iāve seen this somewhere in the past, but I thought it was actually part of the Java API. But I couldnāt find it there as Iāve looked when the discussion started here. But the scala.Enumeration, which nobody ever used, including me, was the source. Dāoh! Thanks to @JD557 for pointing that out.