@@ -399,10 +399,10 @@ class Definitions {
399
399
def getWrapVarargsArrayModule : Symbol = if (isNewCollections) ScalaRuntimeModule else ScalaPredefModule
400
400
401
401
// The set of all wrap{X, Ref}Array methods, where X is a value type
402
- val WrapArrayMethods : PerRun [ collection.Set [Symbol ]] = new PerRun ({ implicit ctx =>
402
+ val WrapArrayMethods : collection.Set [Symbol ] = {
403
403
val methodNames = ScalaValueTypes .map(ast.tpd.wrapArrayMethodName) + nme.wrapRefArray
404
404
methodNames.map(getWrapVarargsArrayModule.requiredMethod(_))
405
- })
405
+ }
406
406
407
407
@ threadUnsafe lazy val NilModule : Symbol = ctx.requiredModule(" scala.collection.immutable.Nil" )
408
408
@@ -878,11 +878,10 @@ class Definitions {
878
878
879
879
// ----- Symbol sets ---------------------------------------------------
880
880
881
- @ threadUnsafe lazy val AbstractFunctionType : Array [TypeRef ] = mkArityArray(" scala.runtime.AbstractFunction" , MaxImplementedFunctionArity , 0 )
882
- val AbstractFunctionClassPerRun : PerRun [Array [Symbol ]] = new PerRun (implicit ctx => AbstractFunctionType .map(_.symbol.asClass))
883
- def AbstractFunctionClass (n : Int )(implicit ctx : Context ): Symbol = AbstractFunctionClassPerRun ()(ctx)(n)
884
- @ threadUnsafe private lazy val ImplementedFunctionType = mkArityArray(" scala.Function" , MaxImplementedFunctionArity , 0 )
885
- def FunctionClassPerRun : PerRun [Array [Symbol ]] = new PerRun (implicit ctx => ImplementedFunctionType .map(_.symbol.asClass))
881
+ @ threadUnsafe lazy val AbstractFunctionClass : Array [Symbol ] =
882
+ mkArityArray(" scala.runtime.AbstractFunction" , MaxImplementedFunctionArity , 0 ).map(_.symbol.asClass)
883
+ @ threadUnsafe lazy val FunctionClass : Array [Symbol ] =
884
+ mkArityArray(" scala.Function" , MaxImplementedFunctionArity , 0 ).map(_.symbol.asClass)
886
885
887
886
val LazyHolder : PerRun [Map [Symbol , Symbol ]] = new PerRun ({ implicit ctx =>
888
887
def holderImpl (holderType : String ) = ctx.requiredClass(" scala.runtime." + holderType)
@@ -909,15 +908,15 @@ class Definitions {
909
908
else if (isErased)
910
909
ctx.requiredClass(" scala.ErasedFunction" + n.toString)
911
910
else if (n <= MaxImplementedFunctionArity )
912
- FunctionClassPerRun ()(ctx) (n)
911
+ FunctionClass (n)
913
912
else
914
913
ctx.requiredClass(" scala.Function" + n.toString)
915
914
916
- @ threadUnsafe lazy val Function0_apply : Symbol = ImplementedFunctionType (0 ).symbol .requiredMethod(nme.apply)
915
+ @ threadUnsafe lazy val Function0_apply : Symbol = FunctionClass (0 ).requiredMethod(nme.apply)
917
916
918
917
def FunctionType (n : Int , isContextual : Boolean = false , isErased : Boolean = false )(implicit ctx : Context ): TypeRef =
919
- if (n <= MaxImplementedFunctionArity && (! isContextual || ctx.erasedTypes) && ! isErased) ImplementedFunctionType (n)
920
- else FunctionClass (n, isContextual, isErased).typeRef
918
+ if (n <= MaxImplementedFunctionArity && (! isContextual || ctx.erasedTypes) && ! isErased) FunctionClass (n).typeRef
919
+ else FunctionClass (n, isContextual, isErased).typeRef // !!!align with FunctionClass?
921
920
922
921
lazy val PolyFunctionClass = ctx.requiredClass(" scala.PolyFunction" )
923
922
def PolyFunctionType = PolyFunctionClass .typeRef
0 commit comments