-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:match-typesarea:pattern-matchingarea:typeclass-derivationbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:bug
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.
Metadata
Metadata
Assignees
Labels
area:match-typesarea:pattern-matchingarea:typeclass-derivationbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:bug