Skip to content

Commit 052bce4

Browse files
Fix Scala 2 library TASTy synthetic unapply optimizations (#19023)
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.
2 parents bd5a2ae + 8ad0121 commit 052bce4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: .github/workflows/ci.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ jobs:
144144
./project/scripts/sbt ";sjsSandbox/run ;sjsSandbox/test ;sjsJUnitTests/test ;set sjsJUnitTests/scalaJSLinkerConfig ~= switchToESModules ;sjsJUnitTests/test ;sjsCompilerTests/test"
145145
146146
- name: Test with Scala 2 library TASTy (fast)
147-
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
147+
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
148148

149149
test_scala2_library_tasty:
150150
runs-on: [self-hosted, Linux]

Diff for: compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ object PatternMatcher {
330330
lazy val caseAccessors = caseClass.caseAccessors
331331

332332
def isSyntheticScala2Unapply(sym: Symbol) =
333-
sym.isAllOf(SyntheticCase) && sym.owner.is(Scala2x)
333+
sym.is(Synthetic) && sym.owner.is(Scala2x)
334334

335335
def tupleApp(i: Int, receiver: Tree) = // manually inlining the call to NonEmptyTuple#apply, because it's an inline method
336336
ref(defn.RuntimeTuplesModule)

0 commit comments

Comments
 (0)