@@ -26,6 +26,7 @@ import ProtoTypes._
26
26
import ErrorReporting ._
27
27
import reporting .diagnostic .Message
28
28
import Inferencing .fullyDefinedType
29
+ import TypeApplications .EtaExpansion
29
30
import Trees ._
30
31
import transform .SymUtils ._
31
32
import transform .TypeUtils ._
@@ -817,12 +818,23 @@ trait Implicits { self: Typer =>
817
818
818
819
/** The mirror type
819
820
*
820
- * <parent> { MirroredMonoType = <monoType; MirroredLabel = <label> }
821
+ * <parent> {
822
+ * MirroredMonoType = <monoType>
823
+ * MirroredTypeConstrictor = <tycon>
824
+ * MirroredLabel = <label> }
821
825
*/
822
- private def mirrorCore (parent : Type , monoType : Type , label : Name )(implicit ctx : Context ) =
826
+ private def mirrorCore (parent : Type , monoType : Type , label : Name )(implicit ctx : Context ) = {
827
+ val mirroredType = monoType match {
828
+ case monoType @ AppliedType (tycon, targs) if targs.forall(_.isInstanceOf [TypeBounds ]) =>
829
+ EtaExpansion (tycon)
830
+ case _ =>
831
+ monoType
832
+ }
823
833
parent
824
834
.refinedWith(tpnme.MirroredMonoType , TypeAlias (monoType))
835
+ .refinedWith(tpnme.MirroredTypeConstructor , TypeAlias (mirroredType))
825
836
.refinedWith(tpnme.MirroredLabel , TypeAlias (ConstantType (Constant (label.toString))))
837
+ }
826
838
827
839
/** A path referencing the companion of class type `clsType` */
828
840
private def companionPath (clsType : Type , span : Span )(implicit ctx : Context ) = {
0 commit comments