
#8883: FlexibleContexts checking should happen also on inferred signature -------------------------------------+------------------------------------ Reporter: Blaisorblade | Owner: jstolarek Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by jstolarek): Inserting a call to `checkValidTheta` after the theta has been zonked (in `tcPolyInfer`) indeed does the job but I can't solve one problem. `checkValidTheta` requires `UserTypeCtxt` parameter. I assume that in this case the value should be `InfSigCtxt`, since we are dealing with inferred signature. The problem is that `InfSigCtxt` requires name of function for which the type has been inferred. This information doesn't seem to be easily available inside `tcPolyInfer`. I noticed that the name is stored inside `name_taus` so I did a hack that calls `checkValidTheta (InfSigCtxt (fst . head $ name_taus)) theta`. In this particular case it works because `fold` name is stored as first in the list. But I don't know what is a general solution for finding name of function for which we are inferring the signature. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8883#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler