Skip to content

Commit 34ce821

Browse files
committed
More unapply changes
1 parent 88b91d4 commit 34ce821

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ object desugar {
3939
* case class method that clashes with a user-defined method?
4040
*/
4141
def isRetractableCaseClassMethodName(name: Name)(implicit ctx: Context): Boolean = name match {
42-
case nme.apply | nme.unapply | nme.copy => true
42+
case nme.apply | nme.unapply | nme.unapplySeq | nme.copy => true
4343
case DefaultGetterName(nme.copy, _) => true
4444
case _ => false
4545
}

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ object SymDenotations {
804804

805805
def isInlineMethod(implicit ctx: Context): Boolean =
806806
is(InlineMethod, butNot = AccessorOrSynthetic) &&
807-
name != nme.unapply // unapply methods do not count as inline methods
807+
!name.isUnapplyName // unapply methods do not count as inline methods
808808
// we need an inline flag on them only do that
809809
// reduceProjection gets access to their rhs
810810

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
460460
changePrec(OrPrec) { toText(trees, " | ") }
461461
case UnApply(fun, implicits, patterns) =>
462462
val extractor = fun match {
463-
case Select(extractor, nme.unapply) => extractor
463+
case Select(extractor, name) if name.isUnapplyName => extractor
464464
case _ => fun
465465
}
466466
toTextLocal(extractor) ~

0 commit comments

Comments
 (0)