Empty constraint tuples are mis-kinded
-- If :: forall k. 'Bool -> k -> k -> k type family If cond tru fls where If True tru fls = tru If False tru fls = fls foo :: If True () (Eq a) => a -> a foo = error "urk"
This should work fine. But we get
Foo.hs:8:21: The third argument of `If' should have kind `*', but `Eq a' has kind `Constraint' In the type signature for `foo': foo :: If True () (Eq a) => a -> a
Reason: GHC is treating the
() unit tuple as of kind
Reason is that in the
HsTupleTy case of
TcHsType, we see
-- In the  case, it's not clear what the kind is, so guess *
And that guess is plain wrong in this case. Unfortunately I don't see an easy fix, but it's plain wrong as-is.