@@ -26,6 +26,7 @@ import ProtoTypes._
2626import ErrorReporting ._
2727import reporting .diagnostic .Message
2828import Inferencing .fullyDefinedType
29+ import TypeApplications .EtaExpansion
2930import Trees ._
3031import transform .SymUtils ._
3132import transform .TypeUtils ._
@@ -861,12 +862,23 @@ trait Implicits { self: Typer =>
861862
862863 /** The mirror type
863864 *
864- * <parent> { MirroredMonoType = <monoType; MirroredLabel = <label> }
865+ * <parent> {
866+ * MirroredMonoType = <monoType>
867+ * MirroredTypeConstrictor = <tycon>
868+ * MirroredLabel = <label> }
865869 */
866- private def mirrorCore (parent : Type , monoType : Type , label : Name )(implicit ctx : Context ) =
870+ private def mirrorCore (parent : Type , monoType : Type , label : Name )(implicit ctx : Context ) = {
871+ val mirroredType = monoType match {
872+ case monoType @ AppliedType (tycon, targs) if targs.forall(_.isInstanceOf [TypeBounds ]) =>
873+ EtaExpansion (tycon)
874+ case _ =>
875+ monoType
876+ }
867877 parent
868878 .refinedWith(tpnme.MirroredMonoType , TypeAlias (monoType))
879+ .refinedWith(tpnme.MirroredTypeConstructor , TypeAlias (mirroredType))
869880 .refinedWith(tpnme.MirroredLabel , TypeAlias (ConstantType (Constant (label.toString))))
881+ }
870882
871883 /** A path referencing the companion of class type `clsType` */
872884 private def companionPath (clsType : Type , span : Span )(implicit ctx : Context ) = {
0 commit comments