
#13998: Default Signature messes up arity of type constructor -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): I'm 99% sure the culprit is [http://git.haskell.org/ghc.git/blob/d7b17517e26007f537feab490509c0e13e0e239a... here]: {{{#!hs mkDefaultMethodType :: Class -> Id -> DefMethSpec Type -> Type -- Returns the top-level type of the default method mkDefaultMethodType _ sel_id VanillaDM = idType sel_id mkDefaultMethodType cls _ (GenericDM dm_ty) = mkSpecSigmaTy cls_tvs [pred] dm_ty where cls_tvs = classTyVars cls pred = mkClassPred cls (mkTyVarTys cls_tvs) }}} The second case (`GenericDM`) is what constructs the type of `$dmeqForallPoly`. Notice that it's using `mkSpecSigmaTy` to prepend the `forall k (f :: k -> *). EqForallPoly f => ...` bit to the rest of the type. However, because it's using `mkSpecSigmaTy`, every class tyvar binder has a visibility of `Specified`, meaning they'll all be available for visible type application, which isn't what we want. However, I'm not sure how to inform GHC that `k` should be invisible, but `f` should be visible, in this code. The problem is that the `Class` data type [http://git.haskell.org/ghc.git/blob/d7b17517e26007f537feab490509c0e13e0e239a... doesn't store any visibility information for its type variables]... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13998#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler