Skip to content

Commit

Permalink
Fix Scala 2 library TASTy synthetic unapply optimizations (#19023)
Browse files Browse the repository at this point in the history
Issue: Synthetic unapplies from the Scala 2 library TASTy do not have
the `Case` flag.


Alternative (4f681a1): Set the `Case`
flag when compiling the Scala 2 library.
  • Loading branch information
nicolasstucki authored Nov 23, 2023
2 parents bd5a2ae + 8ad0121 commit 052bce4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 052bce4

Please sign in to comment.