You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
objectWeekDayextendsEnumeration {
typeWeekDay=ValuevalMon=Value(1)
valTue=Value(1)
}
WeekDay.Mon.id
java.lang.AssertionError: assertion failed
at scala.Predef$$.assert(Predef.scala:78)
at scala.Enumeration$$Val.<init>(Enumeration.scala:266)
at scala.Enumeration.Value(Enumeration.scala:175)
at WeekDay$$.<init>(<console>:8)
at WeekDay$$.<clinit>(<console>)
at .<init>(<console>:7)
at .<clinit>(<console>)
The text was updated successfully, but these errors were encountered:
@dragos said:
And what behavior would you expect? You are breaking an invariant, so I believe an error is in place, and I don't think this is a recoverable error. The program is simply broken and needs to be fixed.
@paulp said:
(In r22446) Enumeration fixes. There was no way to do reflection-based naming
correctly simply by inspecting method signatures (because a Value from
a different Enumeration stored in a val looks identical to one from
this Enumeration) so I have Value store the outer Enum for comparison
purposes. This won't make anything new uncollectable because they
already have an $$outer pointing there. This also simplified the
reflection logic: it's an eq test rather than a series of heuristics.
The text was updated successfully, but these errors were encountered: