@@ -815,11 +815,11 @@ trait Implicits { self: Typer =>
815
815
EmptyTree
816
816
}
817
817
818
- /** Create an anonymous class `new Object { type MonoType = ... }`
818
+ /** Create an anonymous class `new Object { type MirroredMonoType = ... }`
819
819
* and mark it with given attachment so that it is made into a mirror at PostTyper.
820
820
*/
821
821
private def anonymousMirror (monoType : Type , attachment : Property .StickyKey [Unit ], span : Span )(implicit ctx : Context ) = {
822
- val monoTypeDef = untpd.TypeDef (tpnme.MonoType , untpd.TypeTree (monoType))
822
+ val monoTypeDef = untpd.TypeDef (tpnme.MirroredMonoType , untpd.TypeTree (monoType))
823
823
val newImpl = untpd.Template (
824
824
constr = untpd.emptyConstructor,
825
825
parents = untpd.TypeTree (defn.ObjectType ) :: Nil ,
@@ -832,14 +832,14 @@ trait Implicits { self: Typer =>
832
832
833
833
/** The mirror type
834
834
*
835
- * <parent> { MonoType = <monoType; Label = <label> }
835
+ * <parent> { MirroredMonoType = <monoType; MirroredLabel = <label> }
836
836
*/
837
837
private def mirrorCore (parent : Type , monoType : Type , label : Name )(implicit ctx : Context ) =
838
838
parent
839
- .refinedWith(tpnme.MonoType , TypeAlias (monoType))
840
- .refinedWith(tpnme.Label , TypeAlias (ConstantType (Constant (label.toString))))
839
+ .refinedWith(tpnme.MirroredMonoType , TypeAlias (monoType))
840
+ .refinedWith(tpnme.MirroredLabel , TypeAlias (ConstantType (Constant (label.toString))))
841
841
842
- /** An implied instance for a type of the form `Mirror.Product { type MonoType = T }`
842
+ /** An implied instance for a type of the form `Mirror.Product { type MirroredMonoType = T }`
843
843
* where `T` is a generic product type or a case object or an enum case.
844
844
*/
845
845
lazy val synthesizedProductMirror : SpecialHandler =
@@ -868,8 +868,8 @@ trait Implicits { self: Typer =>
868
868
val elemLabels = accessors.map(acc => ConstantType (Constant (acc.name.toString)))
869
869
val mirrorType =
870
870
mirrorCore(defn.Mirror_ProductType , monoType, cls.name)
871
- .refinedWith(tpnme.ElemTypes , TypeAlias (TypeOps .nestedPairs(elemTypes)))
872
- .refinedWith(tpnme.ElemLabels , TypeAlias (TypeOps .nestedPairs(elemLabels)))
871
+ .refinedWith(tpnme.MirroredElemTypes , TypeAlias (TypeOps .nestedPairs(elemTypes)))
872
+ .refinedWith(tpnme.MirroredElemLabels , TypeAlias (TypeOps .nestedPairs(elemLabels)))
873
873
val modul = cls.linkedClass.sourceModule
874
874
assert(modul.is(Module ))
875
875
val mirrorRef =
@@ -879,18 +879,18 @@ trait Implicits { self: Typer =>
879
879
}
880
880
else EmptyTree
881
881
}
882
- formal.member(tpnme.MonoType ).info match {
882
+ formal.member(tpnme.MirroredMonoType ).info match {
883
883
case monoAlias @ TypeAlias (monoType) => mirrorFor(monoType)
884
884
case _ => EmptyTree
885
885
}
886
886
}
887
887
888
- /** An implied instance for a type of the form `Mirror.Sum { type MonoType = T }`
888
+ /** An implied instance for a type of the form `Mirror.Sum { type MirroredMonoType = T }`
889
889
* where `T` is a generic sum type.
890
890
*/
891
891
lazy val synthesizedSumMirror : SpecialHandler =
892
892
(formal : Type , span : Span ) => implicit (ctx : Context ) =>
893
- formal.member(tpnme.MonoType ).info match {
893
+ formal.member(tpnme.MirroredMonoType ).info match {
894
894
case TypeAlias (monoType) if monoType.classSymbol.isGenericSum =>
895
895
val cls = monoType.classSymbol
896
896
val elemTypes = cls.children.map {
@@ -925,7 +925,7 @@ trait Implicits { self: Typer =>
925
925
}
926
926
val mirrorType =
927
927
mirrorCore(defn.Mirror_SumType , monoType, cls.name)
928
- .refinedWith(tpnme.ElemTypes , TypeAlias (TypeOps .nestedPairs(elemTypes)))
928
+ .refinedWith(tpnme.MirroredElemTypes , TypeAlias (TypeOps .nestedPairs(elemTypes)))
929
929
val modul = cls.linkedClass.sourceModule
930
930
val mirrorRef =
931
931
if (modul.exists && ! cls.is(Scala2x )) ref(modul).withSpan(span)
@@ -935,12 +935,12 @@ trait Implicits { self: Typer =>
935
935
EmptyTree
936
936
}
937
937
938
- /** An implied instance for a type of the form `Mirror { type MonoType = T }`
938
+ /** An implied instance for a type of the form `Mirror { type MirroredMonoType = T }`
939
939
* where `T` is a generic sum or product or singleton type.
940
940
*/
941
941
lazy val synthesizedMirror : SpecialHandler =
942
942
(formal : Type , span : Span ) => implicit (ctx : Context ) =>
943
- formal.member(tpnme.MonoType ).info match {
943
+ formal.member(tpnme.MirroredMonoType ).info match {
944
944
case monoAlias @ TypeAlias (monoType) =>
945
945
if (monoType.termSymbol.is(CaseVal ) || monoType.classSymbol.isGenericProduct)
946
946
synthesizedProductMirror(formal, span)(ctx)
0 commit comments