Fix #16518 with some more kind-splitting smarts
This patch corrects two simple oversights that led to #16518 (closed):
-
HsUtils.typeToLHsType
was taking visibility into account in theTyConApp
case, but not theAppTy
case. I've factored out the visibility-related logic into its owngo_app
function and now invokego_app
from both theTyConApp
andAppTy
cases. -
Type.fun_kind_arg_flags
did not properly split kinds with nestedforall
s, such as(forall k. k -> Type) -> (forall k. k -> Type)
. This was simply becausefun_kind_arg_flags
'sFunTy
case always bailed out and assumed all subsequent arguments wereRequired
, which clearly isn't the case for nestedforall
s. I tweaked theFunTy
case to recur on the result kind.