Skip to content

Commit 5482916

Browse files
author
Abel Nieto
committed
Minor review fixes
1 parent 9c2f9c2 commit 5482916

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,10 @@ 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: collection.Set[TermRef] = {
343+
val Predef_wrapArray = new PerRun[collection.Set[Symbol]]({ implicit ctx =>
344344
val methodNames = ScalaValueTypes.map(TreeGen.wrapArrayMethodName) + nme.wrapRefArray
345-
methodNames.map(ScalaPredefModule.requiredMethodRef)
346-
}
347-
val Predef_wrapArray = new PerRun[collection.Set[Symbol]](implicit ctx => Predef_wrapArrayR.map(_.symbol))
345+
methodNames.map(ScalaPredefModule.requiredMethodRef(_).symbol)
346+
})
348347

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

compiler/test/dotty/tools/backend/jvm/DottyBytecodeTests.scala

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,9 @@ class TestBCode extends DottyBytecodeTest {
205205
val moduleNode = loadClassNode(moduleIn.input)
206206
val method = getMethod(moduleNode, "test")
207207

208-
val arrayWrapped = instructionsFromMethod(method).exists { instr: Instruction =>
209-
instr match {
210-
case inv: Invoke => inv.name.contains("wrapRefArray")
211-
case _ => false
212-
}
208+
val arrayWrapped = instructionsFromMethod(method).exists {
209+
case inv: Invoke => inv.name.contains("wrapRefArray")
210+
case _ => false
213211
}
214212

215213
assert(!arrayWrapped, "Arrays should not be wrapped when passed to a Java varargs method\n")

0 commit comments

Comments
 (0)