diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f3c3d6b7e22c..89501ed6c9d1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ jobs: test: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -22,8 +22,8 @@ jobs: startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))" steps: - - name: Set JDK 14 as default - run: echo "/usr/lib/jvm/java-14-openjdk-amd64/bin" >> $GITHUB_PATH + - name: Set JDK 15 as default + run: echo "/usr/lib/jvm/java-15-openjdk-amd64/bin" >> $GITHUB_PATH - name: Checkout cleanup script uses: actions/checkout@v2 @@ -45,7 +45,7 @@ jobs: test_bootstrapped: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -54,8 +54,8 @@ jobs: startsWith(github.event.ref, 'refs/tags/sbt-dotty-'))" steps: - - name: Set JDK 14 as default - run: echo "/usr/lib/jvm/java-14-openjdk-amd64/bin" >> $GITHUB_PATH + - name: Set JDK 15 as default + run: echo "/usr/lib/jvm/java-15-openjdk-amd64/bin" >> $GITHUB_PATH - name: Checkout cleanup script uses: actions/checkout@v2 @@ -110,7 +110,7 @@ jobs: community_build_a: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -138,7 +138,7 @@ jobs: community_build_b: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -166,7 +166,7 @@ jobs: test_sbt: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -196,7 +196,7 @@ jobs: test_java8: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -231,7 +231,7 @@ jobs: publish_nightly: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -265,7 +265,7 @@ jobs: nightly_documentation: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -306,7 +306,7 @@ jobs: publish_release: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -388,7 +388,7 @@ jobs: release_documentation: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache @@ -432,7 +432,7 @@ jobs: publish_sbt_release: runs-on: [self-hosted, Linux] container: - image: lampepfl/dotty:2020-09-08 + image: lampepfl/dotty:2020-11-19 volumes: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache diff --git a/community-build/community-projects/scala-parser-combinators b/community-build/community-projects/scala-parser-combinators index e26d523e93f3..da176a05c462 160000 --- a/community-build/community-projects/scala-parser-combinators +++ b/community-build/community-projects/scala-parser-combinators @@ -1 +1 @@ -Subproject commit e26d523e93f313560aac12bb72ff41ab69abf72b +Subproject commit da176a05c4623c4edb81b1274034ad1e85835dc4 diff --git a/community-build/community-projects/scalatest b/community-build/community-projects/scalatest index 89eeea5a1994..d19f7289828f 160000 --- a/community-build/community-projects/scalatest +++ b/community-build/community-projects/scalatest @@ -1 +1 @@ -Subproject commit 89eeea5a199469b13948ac7f8c827970920ef1f3 +Subproject commit d19f7289828ff062a7dc49d4b04c19118a409a56 diff --git a/compiler/src/dotty/tools/dotc/core/NameOps.scala b/compiler/src/dotty/tools/dotc/core/NameOps.scala index 26ccc5c87932..ed6e54ab9deb 100644 --- a/compiler/src/dotty/tools/dotc/core/NameOps.scala +++ b/compiler/src/dotty/tools/dotc/core/NameOps.scala @@ -2,6 +2,7 @@ package dotty.tools.dotc package core import java.security.MessageDigest +import java.nio.CharBuffer import scala.io.Codec import Int.MaxValue import Names._, StdNames._, Contexts._, Symbols._, Flags._, NameKinds._, Types._ @@ -32,17 +33,18 @@ object NameOps { def apply(s: String): String = { val marker = "$$$$" - val MaxNameLength = (CLASSFILE_NAME_CHAR_LIMIT - 6) min + val MaxNameLength = (CLASSFILE_NAME_CHAR_LIMIT - 6).min( 2 * (CLASSFILE_NAME_CHAR_LIMIT - 6 - 2 * marker.length - 32) + ) def toMD5(s: String, edge: Int): String = { - val prefix = s take edge - val suffix = s takeRight edge + val prefix = s.take(edge) + val suffix = s.takeRight(edge) val cs = s.toArray - val bytes = Codec toUTF8 cs - md5 update bytes - val md5chars = (md5.digest() map (b => (b & 0xFF).toHexString)).mkString + val bytes = Codec.toUTF8(CharBuffer.wrap(cs)) + md5.update(bytes) + val md5chars = md5.digest().map(b => (b & 0xFF).toHexString).mkString prefix + marker + md5chars + marker + suffix } diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index 051451cffd55..3960ac1a37bb 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -724,7 +724,7 @@ trait Applications extends Compatibility { def makeVarArg(n: Int, elemFormal: Type): Unit = { val args = typedArgBuf.takeRight(n).toList - typedArgBuf.trimEnd(n) + typedArgBuf.dropRightInPlace(n) val elemtpt = TypeTree(elemFormal) typedArgBuf += seqToRepeated(SeqLiteral(args, elemtpt)) } diff --git a/project/Build.scala b/project/Build.scala index 25ecac0a125b..88f4a6cb419c 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -72,8 +72,8 @@ object Build { * scala-library. */ def stdlibVersion(implicit mode: Mode): String = mode match { - case NonBootstrapped => "2.13.3" - case Bootstrapped => "2.13.3" + case NonBootstrapped => "2.13.4" + case Bootstrapped => "2.13.4" } val dottyOrganization = "org.scala-lang" diff --git a/project/plugins.sbt b/project/plugins.sbt index 6f83bef934f9..e401892321ab 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,7 +2,7 @@ // // e.g. addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.1") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.6") diff --git a/sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt b/sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt index 3f24e1d347aa..7b620f9a7694 100644 --- a/sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt +++ b/sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt @@ -1,5 +1,5 @@ val scala3Version = sys.props("plugin.scalaVersion") -val scala2Version = "2.13.3" +val scala2Version = "2.13.4" lazy val `i8847-lib` = (project in file ("lib")) .settings(scalaVersion := scala2Version) diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt b/sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt index e9c732d4853a..480bb5e1193b 100644 --- a/sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt +++ b/sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt @@ -1,5 +1,5 @@ val scala3Version = sys.props("plugin.scalaVersion") -val scala2Version = "2.13.3" +val scala2Version = "2.13.4" lazy val `i9916a-lib` = (project in file ("lib")) .settings(scalaVersion := scala2Version) diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt b/sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt index 51a2d056ddad..1b7022040009 100644 --- a/sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt +++ b/sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt @@ -1,5 +1,5 @@ val scala3Version = sys.props("plugin.scalaVersion") -val scala2Version = "2.13.3" +val scala2Version = "2.13.4" lazy val `i9916b-lib` = (project in file ("lib")) .settings(scalaVersion := scala2Version) diff --git a/tests/neg/missing-implicit-2.check b/tests/neg/missing-implicit-2.check index 1cf3c1bcb340..edc200b6dec2 100644 --- a/tests/neg/missing-implicit-2.check +++ b/tests/neg/missing-implicit-2.check @@ -1,12 +1,12 @@ -- Error: tests/neg/missing-implicit-2.scala:4:24 ---------------------------------------------------------------------- 4 |val f = Future[Unit] { } // error | ^ - | Cannot find an implicit ExecutionContext. You might pass + | Cannot find an implicit ExecutionContext. You might add | an (implicit ec: ExecutionContext) parameter to your method. | | The ExecutionContext is used to configure how and on which - | thread pools Futures will run, so the specific ExecutionContext - | that is selected is important. + | thread pools asynchronous tasks (such as Futures) will run, + | so the specific ExecutionContext that is selected is important. | | If your application does not define an ExecutionContext elsewhere, | consider using Scala's global ExecutionContext by defining diff --git a/tests/run/t6260-delambdafy.check b/tests/run/t6260-delambdafy.check index ed107b4c8132..eb7212adc211 100644 --- a/tests/run/t6260-delambdafy.check +++ b/tests/run/t6260-delambdafy.check @@ -1,5 +1,3 @@ f(C@2e) apply -get$Lambda -writeReplace diff --git a/tests/run/t6260-delambdafy.scala b/tests/run/t6260-delambdafy.scala index a4a3cfc8ff02..3aa145d2f1c5 100644 --- a/tests/run/t6260-delambdafy.scala +++ b/tests/run/t6260-delambdafy.scala @@ -1,10 +1,12 @@ +import java.lang.reflect.Modifier + class C[A](private val a: Any) extends AnyVal object Test { val f = (x: C[Any]) => {println(s"f($x)"); x} def main(args: Array[String]): Unit = { f(new C(".")) - val methods = f.getClass.getDeclaredMethods.map(_.getName).sorted + val methods = f.getClass.getDeclaredMethods.filter(m => (m.getModifiers & Modifier.PRIVATE) == 0).map(_.getName).sorted println("") println(methods.mkString("\n")) } diff --git a/tests/run/t8153.scala b/tests/run/t8153.scala deleted file mode 100644 index f3063bdc7bfc..000000000000 --- a/tests/run/t8153.scala +++ /dev/null @@ -1,14 +0,0 @@ -object Test { - def f() = { - val lb = scala.collection.mutable.ListBuffer[Int](1, 2) - val it = lb.iterator - if (it.hasNext) it.next() - val xs = lb.toList - lb += 3 - it.mkString - } - - def main(args: Array[String]): Unit = { - println(f()) - } -}