Skip to content

Commit c364806

Browse files
committed
Revert "Inline _N case class product members under -Yscala2-stdlib"
These product members are only in the bytecode. This reverts commit 8c58cbf.
1 parent c629090 commit c364806

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,7 @@ object desugar {
664664
// new C[...](p1, ..., pN)(moreParams)
665665
val (caseClassMeths, enumScaffolding) = {
666666
def syntheticProperty(name: TermName, tpt: Tree, rhs: Tree) =
667-
val mods = if caseClassInScala2StdLib then synthetic | Inline else synthetic
668-
DefDef(name, Nil, tpt, rhs).withMods(mods)
667+
DefDef(name, Nil, tpt, rhs).withMods(synthetic)
669668

670669
def productElemMeths =
671670
val caseParams = derivedVparamss.head.toArray

project/MiMaFilters.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ object MiMaFilters {
139139
// Companion module class: Missing type java.io.Serializable
140140
ProblemFilters.exclude[MissingTypesProblem]("scala.*$"),
141141

142+
// Case class product accessors
143+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.*._1"),
144+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.*._2"),
145+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.*._3"),
146+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.*._4"),
147+
142148
// abstract method elemTag()scala.reflect.ClassTag in class scala.collection.mutable.ArraySeq does not have a correspondent in other version
143149
ProblemFilters.exclude[DirectAbstractMethodProblem]("scala.collection.immutable.ArraySeq.elemTag"),
144150
ProblemFilters.exclude[DirectAbstractMethodProblem]("scala.collection.mutable.ArraySeq.elemTag"),

stdlib-bootstrapped/test/Main.scala

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ object HelloWorld:
1515

1616
testScala2UnapplySignatures()
1717
testScala2ObjectParents()
18-
testScala2ProductMembers()
1918
}
2019

2120
def testScala2UnapplySignatures() = {
@@ -32,11 +31,3 @@ object HelloWorld:
3231
assert(!typeChecks("Either: scala.deriving.Mirror.Sum"))
3332
assert(!typeChecks("Either: scala.deriving.Mirror"))
3433
}
35-
def testScala2ProductMembers() = {
36-
Some(1)._1
37-
Right(1)._1
38-
(1, 2)._1
39-
(1, 2)._2
40-
::(1, Nil)._1
41-
::(1, Nil)._2
42-
}

0 commit comments

Comments
 (0)