Skip to content

Commit d3f4d91

Browse files
Adapt CompleteJavaEnums to the new method names
1 parent dfe6351 commit d3f4d91

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
@@ -84,15 +84,15 @@ class CompleteJavaEnums extends MiniPhase with InfoTransformer { thisPhase =>
8484
* 2. If this is a $new method that creates simple cases, pass $name and $ordinal parameters
8585
* to the enum superclass. The $new method looks like this:
8686
*
87-
* def $new(..., enumTag: Int, name: String) = {
87+
* def $new(..., ordinal: Int, name: String) = {
8888
* class $anon extends E(...) { ... }
8989
* new $anon
9090
* }
9191
*
9292
* After the transform it is expanded to
9393
*
94-
* def $new(..., enumTag: Int, name: String) = {
95-
* class $anon extends E(..., name, enumTag) { ... }
94+
* def $new(..., ordinal: Int, name: String) = {
95+
* class $anon extends E(..., name, ordinal) { ... }
9696
* new $anon
9797
* }
9898
*/
@@ -122,7 +122,7 @@ class CompleteJavaEnums extends MiniPhase with InfoTransformer { thisPhase =>
122122
*
123123
* class $anon extends E(...) {
124124
* ...
125-
* def enumTag = N
125+
* def ordinal = N
126126
* def toString = S
127127
* ...
128128
* }
@@ -153,7 +153,7 @@ class CompleteJavaEnums extends MiniPhase with InfoTransformer { thisPhase =>
153153
templ.body.collect {
154154
case mdef: DefDef if mdef.name == name => mdef.rhs
155155
}.head
156-
val args = List(rhsOf(nme.toString_), rhsOf(nme.enumTag))
156+
val args = List(rhsOf(nme.toString_), rhsOf(nme.ordinal))
157157
cpy.Template(templ)(
158158
parents = addEnumConstrArgs(cls.owner.owner.linkedClass, templ.parents, args))
159159
}

0 commit comments

Comments
 (0)