@@ -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 ._
@@ -861,12 +862,23 @@ trait Implicits { self: Typer =>
861
862
862
863
/** The mirror type
863
864
*
864
- * <parent> { MirroredMonoType = <monoType; MirroredLabel = <label> }
865
+ * <parent> {
866
+ * MirroredMonoType = <monoType>
867
+ * MirroredTypeConstrictor = <tycon>
868
+ * MirroredLabel = <label> }
865
869
*/
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
+ }
867
877
parent
868
878
.refinedWith(tpnme.MirroredMonoType , TypeAlias (monoType))
879
+ .refinedWith(tpnme.MirroredTypeConstructor , TypeAlias (mirroredType))
869
880
.refinedWith(tpnme.MirroredLabel , TypeAlias (ConstantType (Constant (label.toString))))
881
+ }
870
882
871
883
/** A path referencing the companion of class type `clsType` */
872
884
private def companionPath (clsType : Type , span : Span )(implicit ctx : Context ) = {
0 commit comments