Skip to content

Commit f1aa9fc

Browse files
committed
Remove unnecessary removal of unused accessors
1 parent 724bf9c commit f1aa9fc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

compiler/src/dotty/tools/dotc/transform/SyntheticMethods.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ class SyntheticMethods(thisPhase: DenotTransformer) {
5858
/** The synthetic methods of the case or value class `clazz`. */
5959
def syntheticMethods(clazz: ClassSymbol)(implicit ctx: Context): List[Tree] = {
6060
val clazzType = clazz.appliedRef
61-
lazy val accessors = {
62-
val allAccessors = if (isDerivedValueClass(clazz)) clazz.paramAccessors else clazz.caseAccessors
63-
allAccessors.filterConserve(!_.is(Unused))
64-
}
61+
lazy val accessors =
62+
if (isDerivedValueClass(clazz)) clazz.paramAccessors
63+
else clazz.caseAccessors
64+
6565
val symbolsToSynthesize: List[Symbol] =
6666
if (clazz.is(Case)) {
6767
if (clazz.is(Module)) caseModuleSymbols
@@ -191,7 +191,6 @@ class SyntheticMethods(thisPhase: DenotTransformer) {
191191
*/
192192
def valueHashCodeBody(implicit ctx: Context): Tree = {
193193
assert(accessors.nonEmpty)
194-
assert(accessors.tail.forall(a => a.info.isPhantom || a.is(Unused)))
195194
ref(accessors.head).select(nme.hashCode_).ensureApplied
196195
}
197196

0 commit comments

Comments
 (0)