dotty-feature-requests
dotty-feature-requests copied to clipboard
Lower bound on AnyKind
As of yet,
type I = [X <: AnyKind] =>> X
type K = [X <: AnyKind] =>> [Y <: AnyKind] =>> X
type S = [X[_][_] <: AnyKind] =>> [Y[_] <: AnyKind] =>> [Z <: AnyKind] =>> X[Z][Y[Z]]
@main def hi: Unit = {
type R = S[K[S[I]]][K]
// type R[α][β] = S[K[S[I]]][K][α][β]
// = K[S[I]][α][K[α]][β]
// = S[I][K[α]][β]
// = I[β][K[α][β]]
// = I[β][α]
// = β[α]
val a: R[Int][List] = List(1, 2)
}
doesn't compile.
(I tried with ?
and *
as well instead of _
; I might be using the wrong kind thing in that snippet.)
(Also see: https://github.com/lampepfl/dotty/issues/6451)