Skip to content

Commit 7627258

Browse files
committed
remove duplicated method available by extension method
1 parent cec2001 commit 7627258

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

compiler/src/dotty/tools/dotc/util/Signatures.scala

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import core.Constants.Constant
77
import core.Contexts._
88
import core.Denotations.SingleDenotation
99
import core.Flags
10+
import core.NameOps.isUnapplyName
1011
import core.Names._
1112
import core.Types._
1213
import util.Spans.Span
@@ -159,14 +160,6 @@ object Signatures {
159160
params :: rest
160161
}
161162

162-
/**
163-
* This function is a hack which allows Signatures API to remain unchanged
164-
*
165-
* @return true if denot is "unapply" or "unapplySeq", false otherwise
166-
*/
167-
def isUnapplyDenotation: Boolean =
168-
List(core.Names.termName("unapply"), core.Names.termName("unapplySeq")) contains denot.name
169-
170163
def extractParamNamess(resultType: Type): List[List[Name]] =
171164
if resultType.typeSymbol.flags.is(Flags.CaseClass) && symbol.flags.is(Flags.Synthetic) then
172165
resultType.typeSymbol.primaryConstructor.paramInfo.paramNamess
@@ -189,7 +182,7 @@ object Signatures {
189182
}
190183

191184
denot.info.stripPoly match {
192-
case tpe if isUnapplyDenotation =>
185+
case tpe if denot.name.isUnapplyName =>
193186
val params = toUnapplyParamss(tpe)
194187
if params.nonEmpty then
195188
Some(Signature("", Nil, List(params), None))

0 commit comments

Comments
 (0)