File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1499,7 +1499,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
14991499 false
15001500 }
15011501
1502- def isSubArg (arg1 : Type , arg2 : Type ): Boolean = arg2 match {
1502+ def isSubArg (arg1 : Type , arg2 : Type ): Boolean = arg2 match
15031503 case arg2 : TypeBounds =>
15041504 val arg1norm = arg1 match {
15051505 case arg1 : TypeBounds =>
@@ -1517,14 +1517,16 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
15171517 // embedded `=> T` arguments alone. This clause needs to compensate for that.
15181518 isSubArg(arg1.argInfos.head, arg2res)
15191519 case _ =>
1520- arg1 match {
1520+ arg1 match
15211521 case arg1 : TypeBounds =>
15221522 compareCaptured(arg1, arg2)
1523+ case ExprType (arg1res)
1524+ if ctx.phaseId > elimByNamePhase.id && ! ctx.erasedTypes
1525+ && defn.isByNameFunction(arg2) =>
1526+ isSubArg(arg1res, arg2.argInfos.head)
15231527 case _ =>
15241528 (v > 0 || isSubType(arg2, arg1)) &&
15251529 (v < 0 || isSubType(arg1, arg2))
1526- }
1527- }
15281530
15291531 isSubArg(args1.head, args2.head)
15301532 } && recurArgs(args1.tail, args2.tail, tparams2.tail)
You can’t perform that action at this time.
0 commit comments