From cce6c89e69a8c4226d62b03352fb18a504bc1eb6 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Tue, 7 Nov 2023 17:01:14 +0100 Subject: [PATCH] Fix Scala 2 TASTy accessors in inline patterns reduction --- .github/workflows/ci.yaml | 2 +- compiler/src/dotty/tools/dotc/inlines/InlineReducer.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5f5f616b76da..1f556a290fc3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -143,7 +143,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 - run: ./project/scripts/sbt ";set ThisBuild/Build.useScala2LibraryTasty := true ;scala3-bootstrapped/testCompilation i5" # 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" # only test a subset of test to avoid doubling the CI execution time test_windows_fast: runs-on: [self-hosted, Windows] diff --git a/compiler/src/dotty/tools/dotc/inlines/InlineReducer.scala b/compiler/src/dotty/tools/dotc/inlines/InlineReducer.scala index 2dbfd9117f48..9197f2f52f06 100644 --- a/compiler/src/dotty/tools/dotc/inlines/InlineReducer.scala +++ b/compiler/src/dotty/tools/dotc/inlines/InlineReducer.scala @@ -329,7 +329,7 @@ class InlineReducer(inliner: Inliner)(using Context): val paramCls = paramType.classSymbol if (paramCls.is(Case) && unapp.symbol.is(Synthetic) && scrut <:< paramType) { val caseAccessors = - if (paramCls.is(Scala2x)) paramCls.caseAccessors.filter(_.is(Method)) + if (paramCls.is(Scala2x, butNot = Scala2Tasty)) paramCls.caseAccessors.filter(_.is(Method)) else paramCls.asClass.paramAccessors val selectors = for (accessor <- caseAccessors)