
#15147: Type checker plugin receives Wanteds that are not completely unflattened -------------------------------------+------------------------------------- Reporter: nfrisby | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler (Type | Version: 8.4.1 checker) | Keywords: Resolution: | TypeCheckerPlugins 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 simonpj): I've looked at why the plugin is seeing flattened givens. It has been this way for some time. Currently, when we go "under" an implication constraint we flatten the Givens; and we only unflatten them when we've finished with that implication. When calling a plugin, we have Givens from a whole stack of enclosing implications, and none of them will be unflattened. See the `inert_fsks` field of `InertSet`; and `TcSMonad.unflattenGivens` which uses that field to guide unflattening. You can see that `unflattenGivens` is called by `nestImplicTcS` which goes under an implication. It's quite awkward to unflatten them, in fact... even accessing the unflattening info for the stack of implications would require extra plumbing. Humph. How bad would it be just to document the status quo? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15147#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler