Skip to content

Commit e1f7fdb

Browse files
SyntheticMethods adapted to use ordinal instead of enumTag
1 parent fb35bd3 commit e1f7fdb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ class SyntheticMembers(thisPhase: DenotTransformer) {
362362

363363
/** For an enum T:
364364
*
365-
* def ordinal(x: MirroredMonoType) = x.enumTag
365+
* def ordinal(x: MirroredMonoType) = x.ordinal
366366
*
367367
* For sealed trait with children of normalized types C_1, ..., C_n:
368368
*
@@ -377,7 +377,7 @@ class SyntheticMembers(thisPhase: DenotTransformer) {
377377
* O is O.type.
378378
*/
379379
def ordinalBody(cls: Symbol, param: Tree)(implicit ctx: Context): Tree =
380-
if (cls.is(Enum)) param.select(nme.enumTag)
380+
if (cls.is(Enum)) param.select(nme.ordinal)
381381
else {
382382
val cases =
383383
for ((child, idx) <- cls.children.zipWithIndex) yield {

0 commit comments

Comments
 (0)