From 8ad0121cdfdcdb792d3cbf7f90cb0f471609ce85 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Thu, 23 Nov 2023 10:23:28 +0100 Subject: [PATCH] Fix Scala 2 library TASTy synthetic unapply optimizations --- .github/workflows/ci.yaml | 2 +- compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5c327c0a1ad4..d51bb59afbc9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -144,7 +144,7 @@ jobs: ./project/scripts/sbt ";sjsSandbox/run ;sjsSandbox/test ;sjsJUnitTests/test ;set sjsJUnitTests/scalaJSLinkerConfig ~= switchToESModules ;sjsJUnitTests/test ;sjsCompilerTests/test" - name: Test with Scala 2 library TASTy (fast) - run: ./project/scripts/sbt ";set ThisBuild/Build.useScala2LibraryTasty := true ;scala3-bootstrapped/testCompilation i5; scala3-bootstrapped/testCompilation tests/run/typelevel-peano.scala" # only test a subset of test to avoid doubling the CI execution time + run: ./project/scripts/sbt ";set ThisBuild/Build.useScala2LibraryTasty := true ;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 test_scala2_library_tasty: runs-on: [self-hosted, Linux] diff --git a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala index 05ef16961698..c987e1ac2eb6 100644 --- a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala +++ b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala @@ -330,7 +330,7 @@ object PatternMatcher { lazy val caseAccessors = caseClass.caseAccessors def isSyntheticScala2Unapply(sym: Symbol) = - sym.isAllOf(SyntheticCase) && sym.owner.is(Scala2x) + sym.is(Synthetic) && sym.owner.is(Scala2x) def tupleApp(i: Int, receiver: Tree) = // manually inlining the call to NonEmptyTuple#apply, because it's an inline method ref(defn.RuntimeTuplesModule)