
#15621: Error message involving type families points to wrong location -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler (Type | Version: 8.4.3 checker) | Resolution: | Keywords: TypeFamilies Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj):
What if there is a Refl :: F Int :~: F Int and a Refl :: F Int :~: F Bool in the same function?
It's fine. Each type signature will give rise to its own implication constraint (indeed already does, except that it is optimised away for signatures that are monotypes). So I think that #14185 is not a red herring at all! I agree that there is a tension here. The ''whole point'' of Deriveds, the only reason they exist, is so that we can more vigorously rewrite wanteds with wanteds, and thus find equalities that must hold in any ultimate solution. The trouble is that there may still be a choice of which unifications to do in which order, and that affects error messages. I'm proposing our implication constraints as a way to keep the two sub- problems separate. (They won't ''stay'' separate, because we'll float out any unsolved equality constraints - and indeed deliberately so, so that they can meet friends from other equality constraints and we can learn more equalities thereby. But they will at least ''begin'' separate. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15621#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler