Skip to content

Commit f8a5497

Browse files
authored
Merge pull request scala#10190 from SethTisue/merge-2.12.x-to-2.13.x-20221016
2 parents f3bd333 + 188be3c commit f8a5497

File tree

10 files changed

+80
-22
lines changed

10 files changed

+80
-22
lines changed

.mailmap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,19 @@ Christopher Vogt <[email protected]> <[email protected]>
2424
Damien Obristi <[email protected]>
2525
Daniel C. Sobral <[email protected]>
2626
Daniel C. Sobral <[email protected]> <dcs@dcs-132-CK-NF79.(none)>
27+
Daniel Esik <[email protected]>
2728
Daniel Lorch <[email protected]>
2829
Darcy Shen <[email protected]>
2930
Diego E. Alonso Blas <[email protected]>
3031
Diego E. Alonso Blas <[email protected]>
32+
Eric Huang <[email protected]>
3133
Erik Stenman <[email protected]>
3234
Eugene Burmako <[email protected]>
3335
3436
3537
François Garillot <[email protected]>
3638
39+
Gilad Hoch <[email protected]>
3740
3841
Ilya Sergei <[email protected]>
3942
Ingo Maier <[email protected]>
@@ -92,3 +95,6 @@ Vincent Cremet <[email protected]>
9295
Vladimir Nikolaev <[email protected]>
9396
Vojin Jovanovic <[email protected]>
9497
98+
Zhang Zhipeng <[email protected]>
99+
jxnu-liguobin <[email protected]>
100+

.scala-steward.conf

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@
22
# either. hopefully this is a reasonable compromise value?
33
pullRequests.frequency = "14 days"
44

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

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

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

project/ScaladocSettings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ object ScaladocSettings {
77

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

1313
def extractResourcesFromWebjar = Def.task {

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.7.1
1+
sbt.version=1.7.2

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ buildInfoKeys := Seq[BuildInfoKey](buildClasspath)
1717

1818
buildInfoPackage := "scalabuild"
1919

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

2222
libraryDependencies ++= Seq(
2323
"org.eclipse.jgit" % "org.eclipse.jgit" % "4.11.9.201909030838-r",

src/compiler/scala/tools/nsc/typechecker/Typers.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5104,8 +5104,10 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
51045104
}
51055105

51065106
def typedApply(tree: Apply) = tree match {
5107-
case Apply(Block(stats, expr), args) =>
5108-
typed1(atPos(tree.pos)(Block(stats, Apply(expr, args) setPos tree.pos.makeTransparent)), mode, pt)
5107+
case Apply(blk @ Block(stats, expr), args) =>
5108+
val ap1 = treeCopy.Apply(tree, expr, args).clearType().setPos(tree.pos.makeTransparent)
5109+
val blk1 = treeCopy.Block(blk, stats, ap1).clearType()
5110+
typed1(blk1, mode, pt)
51095111
case Apply(fun, args) =>
51105112
normalTypedApply(tree, fun, args) match {
51115113
case treeInfo.ArrayInstantiation(level, componentType, arg) =>

src/compiler/scala/tools/reflect/package.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ package object reflect {
8989
val NSC_ERROR = Reporter.ERROR
9090

9191
def doReport(pos: Position, msg: String, nscSeverity: NscSeverity): Unit =
92-
frontEnd.log(pos, msg, nscSeverity match {
92+
frontEnd.log(pos, msg, (nscSeverity: @unchecked) match {
9393
case NSC_INFO => API_INFO
9494
case NSC_WARNING => API_WARNING
9595
case NSC_ERROR => API_ERROR

src/scaladoc/scala/tools/nsc/doc/html/HtmlFactory.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class HtmlFactory(val universe: doc.Universe, val reporter: Reporter) {
9595
)
9696

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

101101
/** Generates the Scaladoc site for a model into the site root.

test/junit/scala/tools/nsc/backend/jvm/BytecodeTest.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,8 @@ class BytecodeTest extends BytecodeTesting {
317317
("x$1", true), // captured, assigned in constructor
318318
("y$1", true) // captured
319319
), fs)
320-
val assignedInConstr = getMethod(k, "<init>").instructions.filter(_.opcode == Opcodes.PUTFIELD) map {
321-
case f: Field => f.name
322-
case _ => ??? // @unchecked
320+
val assignedInConstr = getMethod(k, "<init>").instructions.collect {
321+
case f: Field if f.opcode == Opcodes.PUTFIELD => f.name
323322
}
324323
assertEquals(List("$outer", "x$1", "y$1"), assignedInConstr.sorted)
325324
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package scala.tools.nsc.typechecker
2+
3+
import org.junit.Assert.assertEquals
4+
import org.junit.Test
5+
import org.junit.runner.RunWith
6+
import org.junit.runners.JUnit4
7+
8+
import scala.tools.testkit.BytecodeTesting
9+
10+
@RunWith(classOf[JUnit4])
11+
class TreeAttachmentTest extends BytecodeTesting {
12+
13+
import compiler.global._
14+
15+
override def compilerArgs: String = "-Ystop-after:typer"
16+
17+
@Test
18+
def namedApplyInfoAttachmentPreserved(): Unit = {
19+
def compile(testMethodCode: String, call: String): Option[analyzer.NamedApplyInfo] = {
20+
val code =
21+
s"""
22+
|class C {
23+
| $testMethodCode
24+
| def s = ""
25+
| def useTest = $call
26+
|}
27+
|""".stripMargin
28+
29+
compiler.compileClasses(code)
30+
val run = compiler.newRun()
31+
run.compileUnits(newCompilationUnit(code) :: Nil, run.parserPhase)
32+
val tree : Tree = run.units.next().body
33+
val block: Tree = tree.collect { case b: Block => b }.last
34+
block.attachments.get[analyzer.NamedApplyInfo]
35+
}
36+
37+
38+
def vargss(x: Option[analyzer.NamedApplyInfo]): List[List[String]] = x.map(x => mmap(x.vargss)(_.symbol.name.toString)).getOrElse(Nil)
39+
40+
assertEquals(None, compile("def test(a: Any, b: Any)(c: Any)(implicit d: DummyImplicit) = 0", "test(s, s)(s)"))
41+
42+
val expected = List(List("x$2", "x$1"), List("x$3"))
43+
assertEquals(expected, vargss(compile("def test(a: Any, b: Any)(c: Any) = 0", "test(b = s, a = s)(s)")))
44+
assertEquals(expected, vargss(compile("def test(a: Any, b: Any)(c: Any)(implicit d: DummyImplicit) = 0", "test(b = s, a = s)(s)")))
45+
}
46+
}

0 commit comments

Comments
 (0)