Open
Description
Compiler version
3.6.4
Minimized code
sealed trait KV[K, V]
sealed trait Append[Init, KV]
type KeysOf[KVs] = KVs match
case KV[k, v] => k
case Append[init, KV[k, v]] => KeysOf[init] | k
// OK
summon[KeysOf[KV["x", Int]] =:= "x"]
// Error
summon[KeysOf[Append[KV["x", Int], KV["y", String]]] =:= ("x" | "y")]
Output
The match type contains an illegal case:
case Append[init, KV[k, v]] => KeysOf[init] | k
The pattern contains an unaccounted type parameter `k`.
(this error can be ignored for now with `-source:3.3`)
https://scastie.scala-lang.org/6ZDIroNFQQuOwgG78Ju83w
Expectation
Should compile.