Skip to content

Commit 9c2f9c2

Browse files
author
Abel Nieto
committed
Use PerRun when calculating method symbols
1 parent 09dbfc2 commit 9c2f9c2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,11 @@ class Definitions {
340340
lazy val Predef_undefinedR = ScalaPredefModule.requiredMethodRef("???")
341341
def Predef_undefined(implicit ctx: Context) = Predef_undefinedR.symbol
342342
// The set of all wrap{X, Ref}Array methods, where X is a value type
343-
lazy val Predef_wrapArrayR: Set[TermRef] = {
343+
lazy val Predef_wrapArrayR: collection.Set[TermRef] = {
344344
val methodNames = ScalaValueTypes.map(TreeGen.wrapArrayMethodName) + nme.wrapRefArray
345-
methodNames.map(ScalaPredefModule.requiredMethodRef).toSet
345+
methodNames.map(ScalaPredefModule.requiredMethodRef)
346346
}
347-
def Predef_wrapArray(implicit ctx: Context): Set[Symbol] = Predef_wrapArrayR.map(_.symbol)
347+
val Predef_wrapArray = new PerRun[collection.Set[Symbol]](implicit ctx => Predef_wrapArrayR.map(_.symbol))
348348

349349
lazy val ScalaRuntimeModuleRef = ctx.requiredModuleRef("scala.runtime.ScalaRunTime")
350350
def ScalaRuntimeModule(implicit ctx: Context) = ScalaRuntimeModuleRef.symbol

compiler/src/dotty/tools/dotc/transform/ElimRepeated.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class ElimRepeated extends MiniPhase with InfoTransformer { thisPhase =>
9494
private def seqToArray(tree: Tree, pt: Type)(implicit ctx: Context): Tree = tree match {
9595
case SeqLiteral(elems, elemtpt) =>
9696
JavaSeqLiteral(elems, elemtpt)
97-
case app@Apply(fun, args) if defn.Predef_wrapArray.contains(fun.symbol) => // rewrite a call to `wrapXArray(arr)` to `arr`
97+
case app@Apply(fun, args) if defn.Predef_wrapArray().contains(fun.symbol) => // rewrite a call to `wrapXArray(arr)` to `arr`
9898
args.head
9999
case _ =>
100100
val elemType = tree.tpe.elemType

0 commit comments

Comments
 (0)