@@ -3563,36 +3563,6 @@ class Typer extends Namer
3563
3563
case tree : Closure => cpy.Closure (tree)(tpt = TypeTree (pt)).withType(pt)
3564
3564
}
3565
3565
3566
- /** Replace every top-level occurrence of a wildcard type argument by
3567
- * a fresh skolem type. The skolem types are of the form $i.CAP, where
3568
- * $i is a skolem of type `scala.internal.TypeBox`, and `CAP` is its
3569
- * type member. See the documentation of `TypeBox` for a rationale why we do this.
3570
- */
3571
- def captureWildcards (tp : Type )(using Context ): Type = tp match {
3572
- case tp : AndOrType => tp.derivedAndOrType(captureWildcards(tp.tp1), captureWildcards(tp.tp2))
3573
- case tp : RefinedType => tp.derivedRefinedType(captureWildcards(tp.parent), tp.refinedName, tp.refinedInfo)
3574
- case tp : RecType => tp.derivedRecType(captureWildcards(tp.parent))
3575
- case tp : LazyRef => captureWildcards(tp.ref)
3576
- case tp : AnnotatedType => tp.derivedAnnotatedType(captureWildcards(tp.parent), tp.annot)
3577
- case tp @ AppliedType (tycon, args) if tp.hasWildcardArg =>
3578
- tycon.typeParams match {
3579
- case tparams @ ((_ : Symbol ) :: _) =>
3580
- val boundss = tparams.map(_.paramInfo.substApprox(tparams.asInstanceOf [List [TypeSymbol ]], args))
3581
- val args1 = args.zipWithConserve(boundss) { (arg, bounds) =>
3582
- arg match {
3583
- case TypeBounds (lo, hi) =>
3584
- val skolem = SkolemType (defn.TypeBoxClass .typeRef.appliedTo(lo | bounds.loBound, hi & bounds.hiBound))
3585
- TypeRef (skolem, defn.TypeBox_CAP )
3586
- case arg => arg
3587
- }
3588
- }
3589
- tp.derivedAppliedType(tycon, args1)
3590
- case _ =>
3591
- tp
3592
- }
3593
- case _ => tp
3594
- }
3595
-
3596
3566
def adaptToSubType (wtp : Type ): Tree =
3597
3567
// try converting a constant to the target type
3598
3568
ConstFold (tree).tpe.widenTermRefExpr.normalized match
0 commit comments