Skip to content

Commit ed8d324

Browse files
committed
fix
1 parent 1e3cc5a commit ed8d324

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,12 +1944,18 @@ trait Applications extends Compatibility {
19441944
end resolveOverloaded
19451945

19461946
def isApplicableTerm(argTypes: List[Type], resultType: Type, argMatch: ArgMatch)(using Context): TermRef => Boolean =
1947-
onMethod(_, argTypes.nonEmpty):
1948-
isApplicableMethodRef(_, argTypes, resultType, argMatch)
1947+
term => term.widen match
1948+
case _: AppliedType =>
1949+
isApplicableType(term, argTypes, resultType)
1950+
case _ =>
1951+
isApplicableMethodRef(term, argTypes, resultType, argMatch)
19491952

19501953
def isApplicableTerm(argTypes: List[Tree], resultType: Type, keepConstraint: Boolean, argMatch: ArgMatch)(using Context): TermRef => Boolean =
1951-
onMethod(_, argTypes.nonEmpty):
1952-
isApplicableMethodRef(_, argTypes, resultType, keepConstraint, argMatch)
1954+
term => term.widen match
1955+
case _: AppliedType =>
1956+
isApplicableType(term, argTypes, resultType, keepConstraint)
1957+
case _ =>
1958+
isApplicableMethodRef(term, argTypes, resultType, keepConstraint, argMatch)
19531959

19541960

19551961
/** This private version of `resolveOverloaded` does the bulk of the work of

0 commit comments

Comments
 (0)