@@ -513,34 +513,6 @@ class SyntheticMembers(thisPhase: DenotTransformer) {
513
513
Match (param, cases)
514
514
}
515
515
516
- /** For an enum T:
517
- *
518
- * def enumLabel(x: MirroredMonoType) = x.enumLabel
519
- *
520
- * For sealed trait with children of normalized types C_1, ..., C_n:
521
- *
522
- * def enumLabel(x: MirroredMonoType) = x match {
523
- * case _: C_1 => "C_1"
524
- * ...
525
- * case _: C_n => "C_n"
526
- * }
527
- *
528
- * Here, the normalized type of a class C is C[?, ...., ?] with
529
- * a wildcard for each type parameter. The normalized type of an object
530
- * O is O.type.
531
- */
532
- def enumLabelBody (cls : Symbol , param : Tree )(using Context ): Tree =
533
- if (cls.is(Enum )) param.select(nme.enumLabel).ensureApplied
534
- else {
535
- val cases =
536
- for ((child, idx) <- cls.children.zipWithIndex) yield {
537
- val patType = if (child.isTerm) child.termRef else child.rawTypeRef
538
- val pat = Typed (untpd.Ident (nme.WILDCARD ).withType(patType), TypeTree (patType))
539
- CaseDef (pat, EmptyTree , Literal (Constant (child.name.toString)))
540
- }
541
- Match (param, cases)
542
- }
543
-
544
516
/** - If `impl` is the companion of a generic sum, add `deriving.Mirror.Sum` parent
545
517
* and `MirroredMonoType` and `ordinal` members.
546
518
* - If `impl` is the companion of a generic product, add `deriving.Mirror.Product` parent
@@ -592,8 +564,6 @@ class SyntheticMembers(thisPhase: DenotTransformer) {
592
564
addParent(defn.Mirror_SumClass .typeRef)
593
565
addMethod(nme.ordinal, MethodType (monoType.typeRef :: Nil , defn.IntType ), cls,
594
566
ordinalBody(_, _))
595
- addMethod(nme.enumLabel, MethodType (monoType.typeRef :: Nil , defn.StringType ), cls,
596
- enumLabelBody(_, _))
597
567
}
598
568
599
569
if (clazz.is(Module )) {
0 commit comments