Skip to content

Commit c41f1d4

Browse files
committed
Trees#applyOverloaded: remove redundant filtering
Already taken care of by the `typeParamCount(tr) == targs.length` filtering done above.
1 parent 610450f commit c41f1d4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,14 +1532,13 @@ object Trees {
15321532
case tp: PolyType => tp.paramInfos.length
15331533
case _ => 0
15341534
}
1535-
var allAlts = denot.alternatives
1535+
val allAlts = denot.alternatives
15361536
.map(denot => TermRef(receiver.tpe, denot.symbol))
15371537
.filter(tr => typeParamCount(tr) == targs.length)
15381538
.filter { _.widen match {
15391539
case MethodTpe(_, _, x: MethodType) => !x.isImplicitMethod
15401540
case _ => true
15411541
}}
1542-
if (targs.isEmpty) allAlts = allAlts.filterNot(_.widen.isInstanceOf[PolyType])
15431542
val alternatives = ctx.typer.resolveOverloaded(allAlts, proto)
15441543
assert(alternatives.size == 1,
15451544
i"${if (alternatives.isEmpty) "no" else "multiple"} overloads available for " +

0 commit comments

Comments
 (0)