Skip to content

Commit 632a066

Browse files
committed
found pattern
1 parent 67c4247 commit 632a066

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1502,8 +1502,10 @@ trait Applications extends Compatibility {
15021502
}
15031503

15041504
private def onMethod(tp: Type, followApply: Boolean)(p: TermRef => Boolean)(using Context): Boolean = tp match {
1505+
case expr: TermRef if expr.widenSingleton.isInstanceOf[ExprType] =>
1506+
tp.member(nme.apply).hasAltWith(d => p(TermRef(tp, nme.apply, d)))
15051507
case methRef: TermRef if methRef.widenSingleton.isInstanceOf[MethodicType] =>
1506-
p(methRef) || tp.member(nme.apply).hasAltWith(d => p(TermRef(tp, nme.apply, d)))
1508+
p(methRef)
15071509
case mt: MethodicType =>
15081510
p(mt.narrow)
15091511
case _ =>

0 commit comments

Comments
 (0)