Commit ee9b83e
committed
Fix safe-init error in ParamOwner
When bootstrapping the compiler with the `-Ysafe-init` flag, we would
get the following error:
```
[error] -- Error: /Users/rrampersad/Documents/school/URA/dotty/compiler/src/dotty/tools/dotc/parsing/Parsers.scala:53:45
[error] 53 | val Class, Type, TypeParam, Def: 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 `ParamOwner` using a Scala 3 enum. This eliminates the error.
Review by @liufengyun1 parent a05ff76 commit ee9b83e
1 file changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
| 52 | + | |
| 53 | + | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
| |||
2927 | 2926 | | |
2928 | 2927 | | |
2929 | 2928 | | |
2930 | | - | |
| 2929 | + | |
2931 | 2930 | | |
2932 | 2931 | | |
2933 | 2932 | | |
| |||
2962 | 2961 | | |
2963 | 2962 | | |
2964 | 2963 | | |
2965 | | - | |
| 2964 | + | |
2966 | 2965 | | |
2967 | 2966 | | |
2968 | 2967 | | |
| |||
0 commit comments