@@ -67,7 +67,7 @@ class Definitions {
6767 enterTypeField(cls, name, flags |  ClassTypeParamCreationFlags , scope)
6868
6969 private  def  enterSyntheticTypeParam (cls : ClassSymbol , paramFlags : FlagSet , scope : MutableScope , suffix : String  =  " T0" = 
70-  enterTypeParam(cls, suffix.toTypeName.expandedName(cls), ExpandedName   |   paramFlags, scope)
70+  enterTypeParam(cls, suffix.toTypeName.expandedName(cls), paramFlags, scope)
7171
7272 //  NOTE: Ideally we would write `parentConstrs: => Type*` but SIP-24 is only
7373 //  implemented in Dotty and not in Scala 2.
@@ -108,7 +108,7 @@ class Definitions {
108108 * def apply(implicit $x0: T0, ..., $x{N_1}: T{N-1}): R 
109109 * } 
110110 */  
111-  private   def  newFunctionNTrait (name : TypeName ) =  {
111+  def  newFunctionNTrait (name : TypeName ) =  {
112112 val  completer  =  new  LazyType  {
113113 def  complete (denot : SymDenotation )(implicit  ctx : Context ):  Unit  =  {
114114 val  cls  =  denot.asClass.classSymbol
@@ -119,7 +119,7 @@ class Definitions {
119119 enterTypeParam(cls, name ++  " $T" ++  i.toString, Contravariant , decls)
120120 val  resParam  =  enterTypeParam(cls, name ++  " $R" Covariant , decls)
121121 val  (methodType, parentTraits) = 
122-  if  (name.startsWith(tpnme .ImplicitFunction )) {
122+  if  (name.firstPart. startsWith(str .ImplicitFunction )) {
123123 val  superTrait  = 
124124 FunctionType (arity).appliedTo(argParams.map(_.typeRef) :::  resParam.typeRef ::  Nil )
125125 (ImplicitMethodType , ctx.normalizeToClassRefs(superTrait ::  Nil , cls, decls))
@@ -723,12 +723,11 @@ class Definitions {
723723 /**  If type `ref` refers to a class in the scala package, its name, otherwise EmptyTypeName */  
724724 def  scalaClassName (ref : Type )(implicit  ctx : Context ):  TypeName  =  scalaClassName(ref.classSymbol)
725725
726-  private  def  isVarArityClass (cls : Symbol , prefix : Name ) =  {
727-  val  name  =  scalaClassName(cls)
728-  name.startsWith(prefix) && 
729-  name.length >  prefix.length && 
730-  name.drop(prefix.length).forall(_.isDigit)
731-  }
726+  private  def  isVarArityClass (cls : Symbol , prefix : String ) = 
727+  scalaClassName(cls).testSimple(name => 
728+  name.startsWith(prefix) && 
729+  name.length >  prefix.length && 
730+  name.drop(prefix.length).forall(_.isDigit))
732731
733732 def  isBottomClass (cls : Symbol ) = 
734733 cls ==  NothingClass  ||  cls ==  NullClass 
@@ -758,9 +757,9 @@ class Definitions {
758757 */  
759758 def  isSyntheticFunctionClass (cls : Symbol ) =  scalaClassName(cls).isSyntheticFunction
760759
761-  def  isAbstractFunctionClass (cls : Symbol ) =  isVarArityClass(cls, tpnme .AbstractFunction )
762-  def  isTupleClass (cls : Symbol ) =  isVarArityClass(cls, tpnme .Tuple )
763-  def  isProductClass (cls : Symbol ) =  isVarArityClass(cls, tpnme .Product )
760+  def  isAbstractFunctionClass (cls : Symbol ) =  isVarArityClass(cls, str .AbstractFunction )
761+  def  isTupleClass (cls : Symbol ) =  isVarArityClass(cls, str .Tuple )
762+  def  isProductClass (cls : Symbol ) =  isVarArityClass(cls, str .Product )
764763
765764 /**  Returns the erased class of the function class `cls` 
766765 * - FunctionN for N > 22 becomes FunctionXXL 
@@ -933,23 +932,6 @@ class Definitions {
933932
934933 //  ----- Initialization ---------------------------------------------------
935934
936-  /**  Give the scala package a scope where a FunctionN trait is automatically 
937-  * added when someone looks for it. 
938-  */  
939-  private  def  makeScalaSpecial ()(implicit  ctx : Context ) =  {
940-  val  oldInfo  =  ScalaPackageClass .classInfo
941-  val  oldDecls  =  oldInfo.decls
942-  val  newDecls  =  new  MutableScope (oldDecls) {
943-  override  def  lookupEntry (name : Name )(implicit  ctx : Context ):  ScopeEntry  =  {
944-  val  res  =  super .lookupEntry(name)
945-  if  (res ==  null  &&  name.isTypeName &&  name.isSyntheticFunction)
946-  newScopeEntry(newFunctionNTrait(name.asTypeName))
947-  else  res
948-  }
949-  }
950-  ScalaPackageClass .info =  oldInfo.derivedClassInfo(decls =  newDecls)
951-  }
952- 
953935 /**  Lists core classes that don't have underlying bytecode, but are synthesized on-the-fly in every reflection universe */  
954936 lazy  val  syntheticScalaClasses  =  List (
955937 AnyClass ,
@@ -977,8 +959,6 @@ class Definitions {
977959 def  init ()(implicit  ctx : Context ) =  {
978960 this .ctx =  ctx
979961 if  (! _isInitialized) {
980-  makeScalaSpecial()
981- 
982962 //  force initialization of every symbol that is synthesized or hijacked by the compiler
983963 val  forced  =  syntheticCoreClasses ++  syntheticCoreMethods ++  ScalaValueClasses ()
984964
0 commit comments