Skip to content

Commit 831c3c7

Browse files
committed
Fix Scala 2 TASTy accessors in inline patterns reduction
1 parent 3430cbb commit 831c3c7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
./project/scripts/sbt ";sjsSandbox/run ;sjsSandbox/test ;sjsJUnitTests/test ;set sjsJUnitTests/scalaJSLinkerConfig ~= switchToESModules ;sjsJUnitTests/test ;sjsCompilerTests/test"
144144
145145
- name: Test with Scala 2 library TASTy
146-
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
146+
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
147147

148148
test_windows_fast:
149149
runs-on: [self-hosted, Windows]

compiler/src/dotty/tools/dotc/inlines/InlineReducer.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,9 @@ class InlineReducer(inliner: Inliner)(using Context):
329329
val paramCls = paramType.classSymbol
330330
if (paramCls.is(Case) && unapp.symbol.is(Synthetic) && scrut <:< paramType) {
331331
val caseAccessors =
332-
if (paramCls.is(Scala2x)) paramCls.caseAccessors.filter(_.is(Method))
333-
else paramCls.asClass.paramAccessors
332+
if !paramCls.is(Scala2x) then paramCls.asClass.paramAccessors
333+
else if paramCls.is(Scala2Tasty) then paramCls.caseAccessors
334+
else paramCls.caseAccessors.filter(_.is(Method))
334335
val selectors =
335336
for (accessor <- caseAccessors)
336337
yield constToLiteral(reduceProjection(ref(scrut).select(accessor).ensureApplied))

0 commit comments

Comments
 (0)