@@ -438,6 +438,8 @@ object TypeOps:
438
438
tp.origin, fromBelow = variance > 0 || variance == 0 && tp.hasLowerBound)(using mapCtx)
439
439
val lo1 = apply(lo)
440
440
if (lo1 ne lo) lo1 else tp
441
+ case tp : LazyRef =>
442
+ TypeBounds .empty
441
443
case _ =>
442
444
mapOver(tp)
443
445
}
@@ -462,34 +464,6 @@ object TypeOps:
462
464
else
463
465
range(defn.NothingType , defn.AnyType )
464
466
}
465
-
466
- /** Deviation from standard tryWiden:
467
- * - Don't widen F-bounds
468
- */
469
- override def tryWiden (tp : NamedType , pre : Type ): Type = pre.member(tp.name) match {
470
- case d : SingleDenotation =>
471
- val tp1 = d.info.dealiasKeepAnnots
472
- tp1.stripAnnots match {
473
- case TypeAlias (alias) =>
474
- // if H#T = U, then for any x in L..H, x.T =:= U,
475
- // hence we can replace with U under all variances
476
- reapply(alias.rewrapAnnots(tp1))
477
-
478
- case tb : TypeBounds =>
479
- // Don't widen F-bounds
480
- val isFBounds = tb.existsPart(p => p.isInstanceOf [LazyRef ], forceLazy = false )
481
- if isFBounds then NoType
482
- else expandBounds(tb)
483
- case info : SingletonType =>
484
- // if H#x: y.type, then for any x in L..H, x.type =:= y.type,
485
- // hence we can replace with y.type under all variances
486
- reapply(info)
487
- case _ =>
488
- NoType
489
- }
490
- case _ => NoType
491
- }
492
-
493
467
}
494
468
495
469
widenMap(tp)
0 commit comments