File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments