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 {
1762
1762
def adaptPatternArgs (elems : List [Tree ], pt : Type , pos : SrcPos )(using Context ): List [Tree ] =
1763
1763
1764
1764
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
1767
1767
report.error(NamedPatternNotApplicable (pt), pos)
1768
1768
Nil
1769
1769
else
1770
1770
var selNames = pt.namedTupleElementTypes(false ).map(_(0 ))
1771
- if selNames.isEmpty && isCaseClass then
1771
+ if isCaseClass && selNames.isEmpty then
1772
1772
selNames = pt.classSymbol.caseAccessors.map(_.name.asTermName)
1773
1773
val nameToIdx = selNames.zipWithIndex.toMap
1774
1774
val reordered = Array .fill[untpd.Tree ](selNames.length):
1775
1775
untpd.Ident (nme.WILDCARD ).withSpan(wildcardSpan)
1776
- for case arg@ NamedArg (name : TermName , _) <- elems do
1776
+ for case arg @ NamedArg (name : TermName , _) <- elems do
1777
1777
nameToIdx.get(name) match
1778
1778
case Some (idx) =>
1779
1779
if reordered(idx).isInstanceOf [Ident ] then
You can’t perform that action at this time.
0 commit comments