Skip to content

Commit

Permalink
Merge pull request scala#10190 from SethTisue/merge-2.12.x-to-2.13.x-…
Browse files Browse the repository at this point in the history
…20221016
  • Loading branch information
SethTisue committed Oct 16, 2022
2 parents f3bd333 + 188be3c commit f8a5497
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 22 deletions.
6 changes: 6 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@ Christopher Vogt <vogt@epfl.ch> <github.com.nsp@cvogt.org>
Damien Obristi <damien.obrist@gmail.com>
Daniel C. Sobral <dcsobral@gmail.com>
Daniel C. Sobral <dcsobral@gmail.com> <dcs@dcs-132-CK-NF79.(none)>
Daniel Esik <e.danicheg@yandex.ru>
Daniel Lorch <lorch@epfl.ch>
Darcy Shen <da@tubi.tv>
Diego E. Alonso Blas <diesalbla@gmail.com>
Diego E. Alonso Blas <diego.e.a@47deg.com>
Eric Huang <ericdx.hung@gmail.com>
Erik Stenman <stenman@epfl.ch>
Eugene Burmako <xeno.by@gmail.com>
Eugene Burmako <xeno.by@gmail.com> <burmako@epfl.ch>
Eugene Vigdorchik <eugenevigdorchik@epfl.ch> <eugene.vigdorchik@gmail.com>
François Garillot <francois@garillot.net>
Geoff Reedy <geoff@programmer-monk.net> <gereedy@sandia.gov>
Gilad Hoch <giladhoch@gmail.com>
Harrison Houghton <hora.rhino@gmail.com> <hhoughton@learningobjects.com>
Ilya Sergei <ilyas@epfl.ch>
Ingo Maier <ingo.maier@epfl.ch>
Expand Down Expand Up @@ -92,3 +95,6 @@ Vincent Cremet <cremet@epfl.ch>
Vladimir Nikolaev <vladimir.nikolaev9@gmail.com>
Vojin Jovanovic <vojin.jovanovic@epfl.ch>
Vojin Jovanovic <vojin.jovanovic@epfl.ch> <gvojin@gmail.com>
Zhang Zhipeng <pc175@uow.edu.au>
jxnu-liguobin <dreamylost@outlook.com>
philwalk <philwalk9@gmail.com>
29 changes: 17 additions & 12 deletions .scala-steward.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@
# either. hopefully this is a reasonable compromise value?
pullRequests.frequency = "14 days"

# only used internally, and they aren't ours (we aren't dogfooding
# them), and updates are unlikely to benefit us, so there's really no
# need to keep them current
updates.ignore = [ { groupId = "com.fasterxml.jackson.core"} ]
updates.ignore = [ { groupId = "org.slf4j"} ]
updates.ignore = [ { groupId = "org.eclipse.jgit"} ]
updates.ignore = [ { groupId = "org.openjdk.jol"} ]
updates.ignore = [

# Ant support is deprecated, so leave the version where it is
updates.ignore = [ { groupId = "org.apache.ant"} ]
# only used internally, and they aren't ours (we aren't dogfooding
# them), and updates are unlikely to benefit us, so there's really no
# need to keep them current
{ groupId = "com.fasterxml.jackson.core" },
{ groupId = "com.fasterxml.jackson.dataformat" },
{ groupId = "org.slf4j" },
{ groupId = "org.eclipse.jgit" },
{ groupId = "org.openjdk.jol" },

# OSGi stuff is fragile and we suspect it is little-used,
# so let's prefer stability
updates.ignore = [ { groupId = "biz.aQute.bnd"} ]
# Ant support is deprecated, so leave the version where it is
{ groupId = "org.apache.ant" },

# OSGi stuff is fragile and we suspect it is little-used,
# so let's prefer stability
{ groupId = "biz.aQute.bnd" }

]
2 changes: 1 addition & 1 deletion project/ScaladocSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ object ScaladocSettings {

// when this changes, the integrity check in HtmlFactory.scala also needs updating
val webjarResources = Seq(
"org.webjars" % "jquery" % "3.6.0"
"org.webjars" % "jquery" % "3.6.1"
)

def extractResourcesFromWebjar = Def.task {
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.7.1
sbt.version=1.7.2
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildInfoKeys := Seq[BuildInfoKey](buildClasspath)

buildInfoPackage := "scalabuild"

addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.1")

libraryDependencies ++= Seq(
"org.eclipse.jgit" % "org.eclipse.jgit" % "4.11.9.201909030838-r",
Expand Down
6 changes: 4 additions & 2 deletions src/compiler/scala/tools/nsc/typechecker/Typers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5104,8 +5104,10 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
}

def typedApply(tree: Apply) = tree match {
case Apply(Block(stats, expr), args) =>
typed1(atPos(tree.pos)(Block(stats, Apply(expr, args) setPos tree.pos.makeTransparent)), mode, pt)
case Apply(blk @ Block(stats, expr), args) =>
val ap1 = treeCopy.Apply(tree, expr, args).clearType().setPos(tree.pos.makeTransparent)
val blk1 = treeCopy.Block(blk, stats, ap1).clearType()
typed1(blk1, mode, pt)
case Apply(fun, args) =>
normalTypedApply(tree, fun, args) match {
case treeInfo.ArrayInstantiation(level, componentType, arg) =>
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/reflect/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ package object reflect {
val NSC_ERROR = Reporter.ERROR

def doReport(pos: Position, msg: String, nscSeverity: NscSeverity): Unit =
frontEnd.log(pos, msg, nscSeverity match {
frontEnd.log(pos, msg, (nscSeverity: @unchecked) match {
case NSC_INFO => API_INFO
case NSC_WARNING => API_WARNING
case NSC_ERROR => API_ERROR
Expand Down
2 changes: 1 addition & 1 deletion src/scaladoc/scala/tools/nsc/doc/html/HtmlFactory.scala
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class HtmlFactory(val universe: doc.Universe, val reporter: Reporter) {
)

final def webjarResources = List(
("jquery.min.js", "/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=")
("jquery.min.js", "o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=")
)

/** Generates the Scaladoc site for a model into the site root.
Expand Down
5 changes: 2 additions & 3 deletions test/junit/scala/tools/nsc/backend/jvm/BytecodeTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,8 @@ class BytecodeTest extends BytecodeTesting {
("x$1", true), // captured, assigned in constructor
("y$1", true) // captured
), fs)
val assignedInConstr = getMethod(k, "<init>").instructions.filter(_.opcode == Opcodes.PUTFIELD) map {
case f: Field => f.name
case _ => ??? // @unchecked
val assignedInConstr = getMethod(k, "<init>").instructions.collect {
case f: Field if f.opcode == Opcodes.PUTFIELD => f.name
}
assertEquals(List("$outer", "x$1", "y$1"), assignedInConstr.sorted)
}
Expand Down
46 changes: 46 additions & 0 deletions test/junit/scala/tools/nsc/typechecker/TreeAttachmentTest.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package scala.tools.nsc.typechecker

import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4

import scala.tools.testkit.BytecodeTesting

@RunWith(classOf[JUnit4])
class TreeAttachmentTest extends BytecodeTesting {

import compiler.global._

override def compilerArgs: String = "-Ystop-after:typer"

@Test
def namedApplyInfoAttachmentPreserved(): Unit = {
def compile(testMethodCode: String, call: String): Option[analyzer.NamedApplyInfo] = {
val code =
s"""
|class C {
| $testMethodCode
| def s = ""
| def useTest = $call
|}
|""".stripMargin

compiler.compileClasses(code)
val run = compiler.newRun()
run.compileUnits(newCompilationUnit(code) :: Nil, run.parserPhase)
val tree : Tree = run.units.next().body
val block: Tree = tree.collect { case b: Block => b }.last
block.attachments.get[analyzer.NamedApplyInfo]
}


def vargss(x: Option[analyzer.NamedApplyInfo]): List[List[String]] = x.map(x => mmap(x.vargss)(_.symbol.name.toString)).getOrElse(Nil)

assertEquals(None, compile("def test(a: Any, b: Any)(c: Any)(implicit d: DummyImplicit) = 0", "test(s, s)(s)"))

val expected = List(List("x$2", "x$1"), List("x$3"))
assertEquals(expected, vargss(compile("def test(a: Any, b: Any)(c: Any) = 0", "test(b = s, a = s)(s)")))
assertEquals(expected, vargss(compile("def test(a: Any, b: Any)(c: Any)(implicit d: DummyImplicit) = 0", "test(b = s, a = s)(s)")))
}
}

0 comments on commit f8a5497

Please sign in to comment.