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
defordinal= _$ordinal // if `E` does not have `java.lang.Enum` as a parent
178
-
overridedeftoString= $name // if `E` does not have `java.lang.Enum` as a parent
177
+
defordinal= _$ordinal
178
+
defenumLabel= $name
179
+
overridedefproductPrefix= enumLabel // if not overridden in `E`
180
+
overridedeftoString= enumLabel // if not overridden in `E`
179
181
$values.register(this) // register enum value so that `valueOf` and `values` can return it.
180
182
}
181
183
```
182
184
183
185
The anonymous classalso implements the abstract `Product` methods that it inherits from `Enum`.
184
-
The `ordinal` method is only generated if the enumdoes not extend from `java.lang.Enum` (as Scala enums do not extend `java.lang.Enum`s unless explicitly specified). Incase it does, there is no need to generate `ordinal` as `java.lang.Enum` defines it. Similarly there is no need to override `toString` asthat is defined in terms of `name` in
185
-
`java.lang.Enum`.
186
+
The `ordinal` method is only generated if the enumdoes not extend from `java.lang.Enum` (as Scala enums do not extend
187
+
`java.lang.Enum`s unless explicitly specified). Incase it does, there is no need to generate `ordinal` as
188
+
`java.lang.Enum` defines it. Similarly there is no need to override `toString` asthat is defined in terms of `name` in
189
+
`java.lang.Enum`. Finally, `enumLabel` will call `this.name` when `E` extends`java.lang.Enum`.
0 commit comments