Skip to content

Commit 4d155e3

Browse files
committed
Polishings
1 parent b847f6f commit 4d155e3

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,18 @@ object ProtoTypes {
8888
val savedConstraint = ctx.typerState.constraint
8989
val res = pt.widenExpr match {
9090
case pt: FunProto =>
91-
mt match {
91+
mt match
9292
case mt: MethodType =>
9393
constrainResult(resultTypeApprox(mt), pt.resultType)
9494
&& {
95-
if pt.constrainResultDeep then
96-
if mt.isImplicitMethod == (pt.applyKind == ApplyKind.Using) then
97-
val tpargs = pt.args.lazyZip(mt.paramInfos).map(pt.typedArg)
98-
tpargs.tpes.corresponds(mt.paramInfos)(_ <:< _)
99-
else true
95+
if pt.constrainResultDeep
96+
&& mt.isImplicitMethod == (pt.applyKind == ApplyKind.Using)
97+
then
98+
val tpargs = pt.args.lazyZip(mt.paramInfos).map(pt.typedArg)
99+
tpargs.tpes.corresponds(mt.paramInfos)(_ <:< _)
100100
else true
101101
}
102102
case _ => true
103-
}
104103
case _: ValueTypeOrProto if !disregardProto(pt) =>
105104
necessarilyCompatible(mt, pt)
106105
case pt: WildcardType if pt.optBounds.exists =>
@@ -308,7 +307,7 @@ object ProtoTypes {
308307
* @param state The state object to use for tracking the changes to this prototype
309308
* @param constrainResultDeep
310309
* A flag to indicate that constrainResult on this prototype
311-
* should typechec and compare the arguments.
310+
* should typecheck and compare the arguments.
312311
*/
313312
case class FunProto(args: List[untpd.Tree], resType: Type)(
314313
typer: Typer,

0 commit comments

Comments
 (0)