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
When bootstrapping the compiler with the `-Ysafe-init` flag, we would
get the following error:
```
[error] -- Error: /Users/********/dotty/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala:20:39
[error] 20 | val Simple, Object, Class: Value = Value
[error] | ^^^^^
[error] |Calling the external method method Value may cause initialization errors.
```
This error orginates from the Scala 2 `Enumeration` class definition. In order to circumvent this issue, we instead define `CaseKind` using a Scala 3 enum. While this does require enum comparisons using `<` or `<=` to explicitly compare the `ordinal` of the enum variant, it also eliminates the initialization error.
Review by @liufengyun
0 commit comments