Skip to content

Commit 35a20c9

Browse files
Adapt CompleteJavaEnums to the new method names
1 parent 2d7570c commit 35a20c9

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
@@ -87,15 +87,15 @@ class CompleteJavaEnums extends MiniPhase with InfoTransformer { thisPhase =>
8787
* 2. If this is a $new method that creates simple cases, pass $name and $ordinal parameters
8888
* to the enum superclass. The $new method looks like this:
8989
*
90-
* def $new(..., enumTag: Int, name: String) = {
90+
* def $new(..., ordinal: Int, name: String) = {
9191
* class $anon extends E(...) { ... }
9292
* new $anon
9393
* }
9494
*
9595
* After the transform it is expanded to
9696
*
97-
* def $new(..., enumTag: Int, name: String) = {
98-
* class $anon extends E(..., name, enumTag) { ... }
97+
* def $new(..., ordinal: Int, name: String) = {
98+
* class $anon extends E(..., name, ordinal) { ... }
9999
* new $anon
100100
* }
101101
*/
@@ -124,7 +124,7 @@ class CompleteJavaEnums extends MiniPhase with InfoTransformer { thisPhase =>
124124
*
125125
* class $anon extends E(...) {
126126
* ...
127-
* def enumTag = N
127+
* def ordinal = N
128128
* def toString = S
129129
* ...
130130
* }
@@ -150,7 +150,7 @@ class CompleteJavaEnums extends MiniPhase with InfoTransformer { thisPhase =>
150150
templ.body.collect {
151151
case mdef: DefDef if mdef.name == name => mdef.rhs
152152
}.head
153-
val args = List(rhsOf(nme.toString_), rhsOf(nme.enumTag))
153+
val args = List(rhsOf(nme.toString_), rhsOf(nme.ordinal))
154154
cpy.Template(templ)(
155155
parents = addEnumConstrArgs(cls.owner.owner.linkedClass, templ.parents, args))
156156
}

0 commit comments

Comments
 (0)