@@ -88,7 +88,7 @@ class Definitions {
8888 newClassSymbol(ScalaPackageClass , name, EmptyFlags , completer).entered
8989 }
9090
91- /** The trait FunctionN, ImplicitFunctionN, GhostFunctionN or GhostImplicitFunction , for some N
91+ /** The trait FunctionN, ImplicitFunctionN, ErasedFunctionN or ErasedImplicitFunction , for some N
9292 * @param name The name of the trait to be created
9393 *
9494 * FunctionN traits follow this template:
@@ -107,19 +107,19 @@ class Definitions {
107107 * def apply(implicit $x0: T0, ..., $x{N_1}: T{N-1}): R
108108 * }
109109 *
110- * GhostFunctionN traits follow this template:
110+ * ErasedFunctionN traits follow this template:
111111 *
112- * trait GhostFunctionN [T0,...,T{N-1}, R] extends Object {
113- * def apply(ghost $x0: T0, ..., $x{N_1}: T{N-1}): R
112+ * trait ErasedFunctionN [T0,...,T{N-1}, R] extends Object {
113+ * def apply(erased $x0: T0, ..., $x{N_1}: T{N-1}): R
114114 * }
115115 *
116- * GhostImplicitFunctionN traits follow this template:
116+ * ErasedImplicitFunctionN traits follow this template:
117117 *
118- * trait GhostImplicitFunctionN [T0,...,T{N-1}, R] extends Object with GhostFunctionN [T0,...,T{N-1}, R] {
119- * def apply(ghost implicit $x0: T0, ..., $x{N_1}: T{N-1}): R
118+ * trait ErasedImplicitFunctionN [T0,...,T{N-1}, R] extends Object with ErasedFunctionN [T0,...,T{N-1}, R] {
119+ * def apply(erased implicit $x0: T0, ..., $x{N_1}: T{N-1}): R
120120 * }
121121 *
122- * GhostFunctionN and GhostImplicitFunctionN erase to Function0.
122+ * ErasedFunctionN and ErasedImplicitFunctionN erase to Function0.
123123 */
124124 def newFunctionNTrait (name : TypeName ): ClassSymbol = {
125125 val completer = new LazyType {
@@ -132,10 +132,10 @@ class Definitions {
132132 enterTypeParam(cls, paramNamePrefix ++ " T" ++ (i + 1 ).toString, Contravariant , decls).typeRef
133133 }
134134 val resParamRef = enterTypeParam(cls, paramNamePrefix ++ " R" , Covariant , decls).typeRef
135- val methodType = MethodType .maker(isJava = false , name.isImplicitFunction, name.isGhostFunction )
135+ val methodType = MethodType .maker(isJava = false , name.isImplicitFunction, name.isErasedFunction )
136136 val parentTraits =
137137 if (! name.isImplicitFunction) Nil
138- else FunctionType (arity, isGhost = name.isGhostFunction ).appliedTo(argParamRefs ::: resParamRef :: Nil ) :: Nil
138+ else FunctionType (arity, isErased = name.isErasedFunction ).appliedTo(argParamRefs ::: resParamRef :: Nil ) :: Nil
139139 decls.enter(newMethod(cls, nme.apply, methodType(argParamRefs, resParamRef), Deferred ))
140140 denot.info =
141141 ClassInfo (ScalaPackageClass .thisType, cls, ObjectType :: parentTraits, decls)
@@ -756,14 +756,14 @@ class Definitions {
756756 sym.owner.linkedClass.typeRef
757757
758758 object FunctionOf {
759- def apply (args : List [Type ], resultType : Type , isImplicit : Boolean = false , isGhost : Boolean = false )(implicit ctx : Context ) =
760- FunctionType (args.length, isImplicit, isGhost ).appliedTo(args ::: resultType :: Nil )
759+ def apply (args : List [Type ], resultType : Type , isImplicit : Boolean = false , isErased : Boolean = false )(implicit ctx : Context ) =
760+ FunctionType (args.length, isImplicit, isErased ).appliedTo(args ::: resultType :: Nil )
761761 def unapply (ft : Type )(implicit ctx : Context ) = {
762762 val tsym = ft.typeSymbol
763763 if (isFunctionClass(tsym)) {
764764 val targs = ft.dealias.argInfos
765765 if (targs.isEmpty) None
766- else Some (targs.init, targs.last, tsym.name.isImplicitFunction, tsym.name.isGhostFunction )
766+ else Some (targs.init, targs.last, tsym.name.isImplicitFunction, tsym.name.isErasedFunction )
767767 }
768768 else None
769769 }
@@ -827,18 +827,18 @@ class Definitions {
827827
828828 lazy val TupleType = mkArityArray(" scala.Tuple" , MaxTupleArity , 2 )
829829
830- def FunctionClass (n : Int , isImplicit : Boolean = false , isGhost : Boolean = false )(implicit ctx : Context ) = {
831- if (isImplicit && isGhost ) {
830+ def FunctionClass (n : Int , isImplicit : Boolean = false , isErased : Boolean = false )(implicit ctx : Context ) = {
831+ if (isImplicit && isErased ) {
832832 require(n > 0 )
833- ctx.requiredClass(" scala.GhostImplicitFunction " + n.toString)
833+ ctx.requiredClass(" scala.ErasedImplicitFunction " + n.toString)
834834 }
835835 else if (isImplicit) {
836836 require(n > 0 )
837837 ctx.requiredClass(" scala.ImplicitFunction" + n.toString)
838838 }
839- else if (isGhost ) {
839+ else if (isErased ) {
840840 require(n > 0 )
841- ctx.requiredClass(" scala.GhostFunction " + n.toString)
841+ ctx.requiredClass(" scala.ErasedFunction " + n.toString)
842842 }
843843 else if (n <= MaxImplementedFunctionArity ) FunctionClassPerRun ()(ctx)(n)
844844 else ctx.requiredClass(" scala.Function" + n.toString)
@@ -847,9 +847,9 @@ class Definitions {
847847 lazy val Function0_applyR = ImplementedFunctionType (0 ).symbol.requiredMethodRef(nme.apply)
848848 def Function0_apply (implicit ctx : Context ) = Function0_applyR .symbol
849849
850- def FunctionType (n : Int , isImplicit : Boolean = false , isGhost : Boolean = false )(implicit ctx : Context ): TypeRef =
851- if (n <= MaxImplementedFunctionArity && (! isImplicit || ctx.erasedTypes) && ! isGhost ) ImplementedFunctionType (n)
852- else FunctionClass (n, isImplicit, isGhost ).typeRef
850+ def FunctionType (n : Int , isImplicit : Boolean = false , isErased : Boolean = false )(implicit ctx : Context ): TypeRef =
851+ if (n <= MaxImplementedFunctionArity && (! isImplicit || ctx.erasedTypes) && ! isErased ) ImplementedFunctionType (n)
852+ else FunctionClass (n, isImplicit, isErased ).typeRef
853853
854854 private lazy val TupleTypes : Set [TypeRef ] = TupleType .toSet
855855
@@ -874,22 +874,22 @@ class Definitions {
874874 /** Is a function class.
875875 * - FunctionN for N >= 0
876876 * - ImplicitFunctionN for N > 0
877- * - GhostFunctionN for N > 0
878- * - GhostImplicitFunctionN for N > 0
877+ * - ErasedFunctionN for N > 0
878+ * - ErasedImplicitFunctionN for N > 0
879879 */
880880 def isFunctionClass (cls : Symbol ) = scalaClassName(cls).isFunction
881881
882882 /** Is an implicit function class.
883883 * - ImplicitFunctionN for N > 0
884- * - GhostImplicitFunctionN for N > 0
884+ * - ErasedImplicitFunctionN for N > 0
885885 */
886886 def isImplicitFunctionClass (cls : Symbol ) = scalaClassName(cls).isImplicitFunction
887887
888- /** Is an ghost function class.
889- * - GhostFunctionN for N > 0
890- * - GhostImplicitFunctionN for N > 0
888+ /** Is an erased function class.
889+ * - ErasedFunctionN for N > 0
890+ * - ErasedImplicitFunctionN for N > 0
891891 */
892- def isGhostFunctionClass (cls : Symbol ) = scalaClassName(cls).isGhostFunction
892+ def isErasedFunctionClass (cls : Symbol ) = scalaClassName(cls).isErasedFunction
893893
894894 /** Is a class that will be erased to FunctionXXL
895895 * - FunctionN for N >= 22
@@ -915,13 +915,13 @@ class Definitions {
915915 * - FunctionN for 22 > N >= 0 remains as FunctionN
916916 * - ImplicitFunctionN for N > 22 becomes FunctionXXL
917917 * - ImplicitFunctionN for 22 > N >= 0 becomes FunctionN
918- * - GhostFunctionN becomes Function0
919- * - ImplicitGhostFunctionN becomes Function0
918+ * - ErasedFunctionN becomes Function0
919+ * - ImplicitErasedFunctionN becomes Function0
920920 * - anything else becomes a NoSymbol
921921 */
922922 def erasedFunctionClass (cls : Symbol ): Symbol = {
923923 val arity = scalaClassName(cls).functionArity
924- if (cls.name.isGhostFunction ) FunctionClass (0 )
924+ if (cls.name.isErasedFunction ) FunctionClass (0 )
925925 else if (arity > 22 ) FunctionXXLClass
926926 else if (arity >= 0 ) FunctionClass (arity)
927927 else NoSymbol
@@ -932,13 +932,13 @@ class Definitions {
932932 * - FunctionN for 22 > N >= 0 remains as FunctionN
933933 * - ImplicitFunctionN for N > 22 becomes FunctionXXL
934934 * - ImplicitFunctionN for 22 > N >= 0 becomes FunctionN
935- * - GhostFunctionN becomes Function0
936- * - ImplicitGhostFunctionN becomes Function0
935+ * - ErasedFunctionN becomes Function0
936+ * - ImplicitErasedFunctionN becomes Function0
937937 * - anything else becomes a NoType
938938 */
939939 def erasedFunctionType (cls : Symbol ): Type = {
940940 val arity = scalaClassName(cls).functionArity
941- if (cls.name.isGhostFunction ) FunctionType (0 )
941+ if (cls.name.isErasedFunction ) FunctionType (0 )
942942 else if (arity > 22 ) FunctionXXLType
943943 else if (arity >= 0 ) FunctionType (arity)
944944 else NoType
@@ -1008,7 +1008,7 @@ class Definitions {
10081008 def isNonDepFunctionType (tp : Type )(implicit ctx : Context ) = {
10091009 val arity = functionArity(tp)
10101010 val sym = tp.dealias.typeSymbol
1011- arity >= 0 && isFunctionClass(sym) && tp.isRef(FunctionType (arity, sym.name.isImplicitFunction, sym.name.isGhostFunction ).typeSymbol)
1011+ arity >= 0 && isFunctionClass(sym) && tp.isRef(FunctionType (arity, sym.name.isImplicitFunction, sym.name.isErasedFunction ).typeSymbol)
10121012 }
10131013
10141014 /** Is `tp` a representation of a (possibly depenent) function type or an alias of such? */
@@ -1074,8 +1074,8 @@ class Definitions {
10741074 def isImplicitFunctionType (tp : Type )(implicit ctx : Context ): Boolean =
10751075 asImplicitFunctionType(tp).exists
10761076
1077- def isGhostFunctionType (tp : Type )(implicit ctx : Context ) =
1078- isFunctionType(tp) && tp.dealias.typeSymbol.name.isGhostFunction
1077+ def isErasedFunctionType (tp : Type )(implicit ctx : Context ) =
1078+ isFunctionType(tp) && tp.dealias.typeSymbol.name.isErasedFunction
10791079
10801080 // ----- primitive value class machinery ------------------------------------------
10811081
0 commit comments