Skip to content

Commit c0daac1

Browse files
committed
More unapply changes
1 parent 9c069c1 commit c0daac1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ object desugar {
5454
* case class method that clashes with a user-defined method?
5555
*/
5656
def isRetractableCaseClassMethodName(name: Name)(implicit ctx: Context): Boolean = name match {
57-
case nme.apply | nme.unapply | nme.copy => true
57+
case nme.apply | nme.unapply | nme.unapplySeq | nme.copy => true
5858
case DefaultGetterName(nme.copy, _) => true
5959
case _ => false
6060
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,8 @@ object SymDenotations {
806806
def isSkolem: Boolean = name == nme.SKOLEM
807807

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
463463
changePrec(OrPrec) { toText(trees, " | ") }
464464
case UnApply(fun, implicits, patterns) =>
465465
val extractor = fun match {
466-
case Select(extractor, nme.unapply) => extractor
466+
case Select(extractor, name) if name.isUnapplyName => extractor
467467
case _ => fun
468468
}
469469
toTextLocal(extractor) ~

0 commit comments

Comments
 (0)