Skip to content

Commit d4326c4

Browse files
committed
PR styling comments.
1 parent f4a16c9 commit d4326c4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,18 +1762,18 @@ object desugar {
17621762
def adaptPatternArgs(elems: List[Tree], pt: Type, pos: SrcPos)(using Context): List[Tree] =
17631763

17641764
def reorderedNamedArgs(wildcardSpan: Span): List[untpd.Tree] =
1765-
val isCaseClass = pt.classSymbol.is(CaseClass) && !defn.isTupleClass(pt.classSymbol)
1766-
if !pt.isNamedTupleType && !isCaseClass then
1765+
inline def isCaseClass = pt.classSymbol.is(CaseClass) && !defn.isTupleClass(pt.classSymbol)
1766+
if !isCaseClass && !pt.isNamedTupleType then
17671767
report.error(NamedPatternNotApplicable(pt), pos)
17681768
Nil
17691769
else
17701770
var selNames = pt.namedTupleElementTypes(false).map(_(0))
1771-
if selNames.isEmpty && isCaseClass then
1771+
if isCaseClass && selNames.isEmpty then
17721772
selNames = pt.classSymbol.caseAccessors.map(_.name.asTermName)
17731773
val nameToIdx = selNames.zipWithIndex.toMap
17741774
val reordered = Array.fill[untpd.Tree](selNames.length):
17751775
untpd.Ident(nme.WILDCARD).withSpan(wildcardSpan)
1776-
for case arg@NamedArg(name: TermName, _) <- elems do
1776+
for case arg @ NamedArg(name: TermName, _) <- elems do
17771777
nameToIdx.get(name) match
17781778
case Some(idx) =>
17791779
if reordered(idx).isInstanceOf[Ident] then

0 commit comments

Comments
 (0)