Skip to content

Commit 5d5d108

Browse files
Adapt CompleteJavaEnums to the new method names
1 parent d1cc980 commit 5d5d108

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/src/dotty/tools/dotc/transform/CompleteJavaEnums.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ class CompleteJavaEnums extends MiniPhase with InfoTransformer { thisPhase =>
8383
* 2. If this is a $new method that creates simple cases, pass $name and $ordinal parameters
8484
* to the enum superclass. The $new method looks like this:
8585
*
86-
* def $new(..., enumTag: Int, name: String) = {
86+
* def $new(..., ordinal: Int, name: String) = {
8787
* class $anon extends E(...) { ... }
8888
* new $anon
8989
* }
9090
*
9191
* After the transform it is expanded to
9292
*
93-
* def $new(..., enumTag: Int, name: String) = {
94-
* class $anon extends E(..., name, enumTag) { ... }
93+
* def $new(..., ordinal: Int, name: String) = {
94+
* class $anon extends E(..., name, ordinal) { ... }
9595
* new $anon
9696
* }
9797
*/
@@ -121,7 +121,7 @@ class CompleteJavaEnums extends MiniPhase with InfoTransformer { thisPhase =>
121121
*
122122
* class $anon extends E(...) {
123123
* ...
124-
* def enumTag = N
124+
* def ordinal = N
125125
* def toString = S
126126
* ...
127127
* }
@@ -152,7 +152,7 @@ class CompleteJavaEnums extends MiniPhase with InfoTransformer { thisPhase =>
152152
templ.body.collect {
153153
case mdef: DefDef if mdef.name == name => mdef.rhs
154154
}.head
155-
val args = List(rhsOf(nme.toString_), rhsOf(nme.enumTag))
155+
val args = List(rhsOf(nme.toString_), rhsOf(nme.ordinal))
156156
cpy.Template(templ)(
157157
parents = addEnumConstrArgs(cls.owner.owner.linkedClass, templ.parents, args))
158158
}

0 commit comments

Comments
 (0)