-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathi16018d.scala
More file actions
17 lines (14 loc) · 850 Bytes
/
i16018d.scala
File metadata and controls
17 lines (14 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Additional negative coverage for the fix to `TypeComparer.compareCaptured`
// (#16018). The companion `pos/i16018d.scala` widens coverage to
// HKT-nested Function1, intersection, path-dependent, and acyclic dependent
// bound shapes. This file pins that recursive parameter bounds stay on the
// old conservative path: the surface widening would otherwise accept a
// relation that frozen Ycheck cannot justify.
object Test:
// ---- A. F-bounded parameter: recursive bound guard -------------------
//
// The guard rejects this at compile time. Without it, the surface widening
// `(M & FBounded[M]) <: M` succeeds but produces a typed tree that fails
// frozen Ycheck:all with assertions like `M <:< xs.T`.
class FBounded[+T <: FBounded[T]]
def f_bounded_guard[M <: FBounded[M]](xs: FBounded[? <: M]): FBounded[M] = xs // error