Skip to content

Commit 0a0fa3e

Browse files
SyntheticMethods' ordinal method calls the arg's ordinal method
1 parent 5d5d108 commit 0a0fa3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.ordinal)
380+
if (cls.is(Enum)) Apply(param.select(nme.ordinal), Nil)
381381
else {
382382
val cases =
383383
for ((child, idx) <- cls.children.zipWithIndex) yield {

0 commit comments

Comments
 (0)