Skip to content

Commit a32c1d8

Browse files
committed
Upgrade to Scala 2.13.4, switch CI to JDK 15
2.13.4 brings JDK 15 support with scala/scala#9292 - tests/run/t8153.scala was removed like it was removed in Scala 2 with scala/scala@8f6e522 - tests/neg/missing-implicit-2.check was updated because the implicitNotFound message was changed in 2.13.4 - tests/run/t6260-delambdafy.scala had to be changed to behave the same under JDK <= 15 and JDK 15.
1 parent dfe6f3e commit a32c1d8

File tree

11 files changed

+35
-47
lines changed

11 files changed

+35
-47
lines changed

.github/workflows/ci.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
test:
1414
runs-on: [self-hosted, Linux]
1515
container:
16-
image: lampepfl/dotty:2020-09-08
16+
image: lampepfl/dotty:2020-11-19
1717
volumes:
1818
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
1919
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
@@ -22,8 +22,8 @@ jobs:
2222
startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))"
2323

2424
steps:
25-
- name: Set JDK 14 as default
26-
run: echo "/usr/lib/jvm/java-14-openjdk-amd64/bin" >> $GITHUB_PATH
25+
- name: Set JDK 15 as default
26+
run: echo "/usr/lib/jvm/java-15-openjdk-amd64/bin" >> $GITHUB_PATH
2727

2828
- name: Checkout cleanup script
2929
uses: actions/checkout@v2
@@ -45,7 +45,7 @@ jobs:
4545
test_bootstrapped:
4646
runs-on: [self-hosted, Linux]
4747
container:
48-
image: lampepfl/dotty:2020-09-08
48+
image: lampepfl/dotty:2020-11-19
4949
volumes:
5050
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
5151
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
@@ -54,8 +54,8 @@ jobs:
5454
startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))"
5555

5656
steps:
57-
- name: Set JDK 14 as default
58-
run: echo "/usr/lib/jvm/java-14-openjdk-amd64/bin" >> $GITHUB_PATH
57+
- name: Set JDK 15 as default
58+
run: echo "/usr/lib/jvm/java-15-openjdk-amd64/bin" >> $GITHUB_PATH
5959

6060
- name: Checkout cleanup script
6161
uses: actions/checkout@v2
@@ -110,7 +110,7 @@ jobs:
110110
community_build_a:
111111
runs-on: [self-hosted, Linux]
112112
container:
113-
image: lampepfl/dotty:2020-09-08
113+
image: lampepfl/dotty:2020-11-19
114114
volumes:
115115
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
116116
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
@@ -138,7 +138,7 @@ jobs:
138138
community_build_b:
139139
runs-on: [self-hosted, Linux]
140140
container:
141-
image: lampepfl/dotty:2020-09-08
141+
image: lampepfl/dotty:2020-11-19
142142
volumes:
143143
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
144144
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
@@ -166,7 +166,7 @@ jobs:
166166
test_sbt:
167167
runs-on: [self-hosted, Linux]
168168
container:
169-
image: lampepfl/dotty:2020-09-08
169+
image: lampepfl/dotty:2020-11-19
170170
volumes:
171171
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
172172
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
@@ -196,7 +196,7 @@ jobs:
196196
test_java8:
197197
runs-on: [self-hosted, Linux]
198198
container:
199-
image: lampepfl/dotty:2020-09-08
199+
image: lampepfl/dotty:2020-11-19
200200
volumes:
201201
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
202202
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
@@ -231,7 +231,7 @@ jobs:
231231
publish_nightly:
232232
runs-on: [self-hosted, Linux]
233233
container:
234-
image: lampepfl/dotty:2020-09-08
234+
image: lampepfl/dotty:2020-11-19
235235
volumes:
236236
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
237237
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
@@ -265,7 +265,7 @@ jobs:
265265
nightly_documentation:
266266
runs-on: [self-hosted, Linux]
267267
container:
268-
image: lampepfl/dotty:2020-09-08
268+
image: lampepfl/dotty:2020-11-19
269269
volumes:
270270
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
271271
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
@@ -306,7 +306,7 @@ jobs:
306306
publish_release:
307307
runs-on: [self-hosted, Linux]
308308
container:
309-
image: lampepfl/dotty:2020-09-08
309+
image: lampepfl/dotty:2020-11-19
310310
volumes:
311311
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
312312
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
@@ -388,7 +388,7 @@ jobs:
388388
release_documentation:
389389
runs-on: [self-hosted, Linux]
390390
container:
391-
image: lampepfl/dotty:2020-09-08
391+
image: lampepfl/dotty:2020-11-19
392392
volumes:
393393
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
394394
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
@@ -432,7 +432,7 @@ jobs:
432432
publish_sbt_release:
433433
runs-on: [self-hosted, Linux]
434434
container:
435-
image: lampepfl/dotty:2020-09-08
435+
image: lampepfl/dotty:2020-11-19
436436
volumes:
437437
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
438438
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package dotty.tools.dotc
22
package core
33

44
import java.security.MessageDigest
5+
import java.nio.CharBuffer
56
import scala.io.Codec
67
import Int.MaxValue
78
import Names._, StdNames._, Contexts._, Symbols._, Flags._, NameKinds._, Types._
@@ -32,17 +33,18 @@ object NameOps {
3233
def apply(s: String): String = {
3334
val marker = "$$$$"
3435

35-
val MaxNameLength = (CLASSFILE_NAME_CHAR_LIMIT - 6) min
36+
val MaxNameLength = (CLASSFILE_NAME_CHAR_LIMIT - 6).min(
3637
2 * (CLASSFILE_NAME_CHAR_LIMIT - 6 - 2 * marker.length - 32)
38+
)
3739

3840
def toMD5(s: String, edge: Int): String = {
39-
val prefix = s take edge
40-
val suffix = s takeRight edge
41+
val prefix = s.take(edge)
42+
val suffix = s.takeRight(edge)
4143

4244
val cs = s.toArray
43-
val bytes = Codec toUTF8 cs
44-
md5 update bytes
45-
val md5chars = (md5.digest() map (b => (b & 0xFF).toHexString)).mkString
45+
val bytes = Codec.toUTF8(CharBuffer.wrap(cs))
46+
md5.update(bytes)
47+
val md5chars = md5.digest().map(b => (b & 0xFF).toHexString).mkString
4648

4749
prefix + marker + md5chars + marker + suffix
4850
}

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ trait Applications extends Compatibility {
724724

725725
def makeVarArg(n: Int, elemFormal: Type): Unit = {
726726
val args = typedArgBuf.takeRight(n).toList
727-
typedArgBuf.trimEnd(n)
727+
typedArgBuf.dropRightInPlace(n)
728728
val elemtpt = TypeTree(elemFormal)
729729
typedArgBuf += seqToRepeated(SeqLiteral(args, elemtpt))
730730
}

project/Build.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ object Build {
7272
* scala-library.
7373
*/
7474
def stdlibVersion(implicit mode: Mode): String = mode match {
75-
case NonBootstrapped => "2.13.3"
76-
case Bootstrapped => "2.13.3"
75+
case NonBootstrapped => "2.13.4"
76+
case Bootstrapped => "2.13.4"
7777
}
7878

7979
val dottyOrganization = "org.scala-lang"

sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
val scala3Version = sys.props("plugin.scalaVersion")
2-
val scala2Version = "2.13.3"
2+
val scala2Version = "2.13.4"
33

44
lazy val `i8847-lib` = (project in file ("lib"))
55
.settings(scalaVersion := scala2Version)

sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
val scala3Version = sys.props("plugin.scalaVersion")
2-
val scala2Version = "2.13.3"
2+
val scala2Version = "2.13.4"
33

44
lazy val `i9916a-lib` = (project in file ("lib"))
55
.settings(scalaVersion := scala2Version)

sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
val scala3Version = sys.props("plugin.scalaVersion")
2-
val scala2Version = "2.13.3"
2+
val scala2Version = "2.13.4"
33

44
lazy val `i9916b-lib` = (project in file ("lib"))
55
.settings(scalaVersion := scala2Version)

tests/neg/missing-implicit-2.check

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
-- Error: tests/neg/missing-implicit-2.scala:4:24 ----------------------------------------------------------------------
22
4 |val f = Future[Unit] { } // error
33
| ^
4-
| Cannot find an implicit ExecutionContext. You might pass
4+
| Cannot find an implicit ExecutionContext. You might add
55
| an (implicit ec: ExecutionContext) parameter to your method.
66
|
77
| The ExecutionContext is used to configure how and on which
8-
| thread pools Futures will run, so the specific ExecutionContext
9-
| that is selected is important.
8+
| thread pools asynchronous tasks (such as Futures) will run,
9+
| so the specific ExecutionContext that is selected is important.
1010
|
1111
| If your application does not define an ExecutionContext elsewhere,
1212
| consider using Scala's global ExecutionContext by defining

tests/run/t6260-delambdafy.check

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
f(C@2e)
22

33
apply
4-
get$Lambda
5-
writeReplace

tests/run/t6260-delambdafy.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import java.lang.reflect.Modifier
2+
13
class C[A](private val a: Any) extends AnyVal
24

35
object Test {
46
val f = (x: C[Any]) => {println(s"f($x)"); x}
57
def main(args: Array[String]): Unit = {
68
f(new C("."))
7-
val methods = f.getClass.getDeclaredMethods.map(_.getName).sorted
9+
val methods = f.getClass.getDeclaredMethods.filter(m => (m.getModifiers & Modifier.PRIVATE) == 0).map(_.getName).sorted
810
println("")
911
println(methods.mkString("\n"))
1012
}

tests/run/t8153.scala

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)