Skip to content

Commit 932bb1d

Browse files
committed
fix
1 parent db67334 commit 932bb1d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3727,12 +3727,15 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
37273727
if tree.tpe.isErroneous || pt.isErroneous then
37283728
tree.withType(UnspecifiedErrorType)
37293729
else
3730-
alts.map(_.widen) match {
3731-
case List(_: AppliedType, _: MethodType) | List(_: MethodType, _: AppliedType) => errorAmbiguous
3732-
case List(ExprType(_: AppliedType), _: MethodType) | List(_: MethodType, ExprType(_: AppliedType)) => errorAmbiguous
3733-
case _ => tryParameterless(alts)(errorAmbiguous)
3734-
}
3735-
3730+
pt match
3731+
case _: FunProto => errorAmbiguous
3732+
case _ =>
3733+
alts.map(_.widen) match
3734+
case List(_: AppliedType, _: MethodType) | List(_: MethodType, _: AppliedType) => errorAmbiguous
3735+
case List(ExprType(_: AppliedType), _: MethodType) | List(_: MethodType, ExprType(_: AppliedType)) => errorAmbiguous
3736+
case _ => tryParameterless(alts)(errorAmbiguous)
3737+
end match
3738+
end match
37363739
end match
37373740
end adaptOverloaded
37383741

0 commit comments

Comments
 (0)