Check kinds for ambiguity
GHC does an ambiguity check on types. It should also do the same for kinds. Here is a program that should be rejected:
type family F a data T :: F a -> Type
T's kind is ambiguous, and any occurrence of
T will be rejected. Instead of rejecting usage sites, let's just reject the definition site.
This check would be disabled by
Happily, I think the implementation should be easy, and that the current algorithm to check for ambiguous types should work for kinds, too. After all, types and kinds are the same these days.
This was inspired by #14203 (closed), but no need to read that ticket to understand this one.