Skip to content

Commit 861e59b

Browse files
committed
Revert "Use substApprox for F-bounds instantiation"
This reverts commit 48f7ed6.
1 parent 48f7ed6 commit 861e59b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,8 @@ object Checking {
7575
}.getOrElse(TypeTree(tparam.paramRef))
7676
val orderedArgs = if (hasNamedArg(args)) tparams.map(argNamed) else args
7777
val bounds = tparams.map(_.paramInfoAsSeenFrom(tree.tpe).bounds)
78-
def instantiate(bound: Type, args: List[Type]) = tparams match {
79-
case (_: Symbol) :: _ if args.exists(_.isInstanceOf[TypeBounds]) =>
80-
bound.substApprox(tparams.asInstanceOf[List[Symbol]], args)
81-
case _ =>
82-
HKTypeLambda.fromParams(tparams, bound).appliedTo(args)
83-
}
78+
def instantiate(bound: Type, args: List[Type]) =
79+
HKTypeLambda.fromParams(tparams, bound).appliedTo(args)
8480
if (boundsCheck) checkBounds(orderedArgs, bounds, instantiate)
8581

8682
def checkWildcardApply(tp: Type): Unit = tp match {

0 commit comments

Comments
 (0)