From 3964a045db1925917023cf0a86e0ce748e6e7d65 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Thu, 29 Feb 2024 09:36:21 +0100 Subject: [PATCH] Fix patch of #19798 This added a an override for the unapply method to fix the signature, but this method does not exist in the original library. We inline all calls to it to avoid any runtime calls to this new override. Fixes #19819 --- .github/workflows/ci.yaml | 2 +- scala2-library-cc/src/scala/collection/SeqView.scala | 2 +- tests/run/i19819.scala | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 tests/run/i19819.scala diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 80960212f8c1..6ffe0b5983d2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -153,7 +153,7 @@ jobs: run: ./project/scripts/sbt ";set ThisBuild/Build.scala2Library := Build.Scala2LibraryTasty ;scala3-bootstrapped/testCompilation i5; scala3-bootstrapped/testCompilation tests/run/typelevel-peano.scala; scala3-bootstrapped/testOnly dotty.tools.backend.jvm.DottyBytecodeTests" # only test a subset of test to avoid doubling the CI execution time - name: Test with Scala 2 library with CC TASTy (fast) - run: ./project/scripts/sbt ";set ThisBuild/Build.scala2Library := Build.Scala2LibraryCCTasty; scala2-library-cc/compile; scala2-library-cc-tasty/compile; scala3-bootstrapped/testCompilation i3" + run: ./project/scripts/sbt ";set ThisBuild/Build.scala2Library := Build.Scala2LibraryCCTasty; scala2-library-cc/compile; scala2-library-cc-tasty/compile; scala3-bootstrapped/testCompilation i3; scala3-bootstrapped/testCompilation tests/run/i19819.scala" test_scala2_library_tasty: runs-on: [self-hosted, Linux] diff --git a/scala2-library-cc/src/scala/collection/SeqView.scala b/scala2-library-cc/src/scala/collection/SeqView.scala index c66d7b5f4694..c4e0f5375e4c 100644 --- a/scala2-library-cc/src/scala/collection/SeqView.scala +++ b/scala2-library-cc/src/scala/collection/SeqView.scala @@ -48,7 +48,7 @@ trait SeqView[+A] extends SeqViewOps[A, View, View[A]] with View[A] { // Copied from SeqOps. This is needed due to the change of class hierarchy in stdlib. // See #19660. - override def updated[B >: A](index: Int, elem: B): View[B]^{this} = { + inline override def updated[B >: A](index: Int, elem: B): View[B]^{this} = { if(index < 0) throw new IndexOutOfBoundsException(index.toString) val k = knownSize if(k >= 0 && index >= k) throw new IndexOutOfBoundsException(index.toString) diff --git a/tests/run/i19819.scala b/tests/run/i19819.scala new file mode 100644 index 000000000000..31bfd2742d92 --- /dev/null +++ b/tests/run/i19819.scala @@ -0,0 +1 @@ +@main def Test = Vector(1, 2, 3).view.updated(1, 8)