#11667: Incorrect pattern synonym types in error messages -------------------------------------+------------------------------------- Reporter: rdragon | Owner: rdragon Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1-rc2 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #11213 | Differential Rev(s): Phab:D1967 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"997312b04c56017197250096d61f3e8fab502319/ghc" 997312b/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="997312b04c56017197250096d61f3e8fab502319" Add `PatSynSigSkol` and modify `PatSynCtxt` As the type of a pattern synonym cannot in general be represented by a value of type Type, we cannot use a value `SigSkol (PatSynCtxt n) (Check ty)` to represent the signature of a pattern synonym (this causes incorrect signatures to be printed in error messages). Therefore we now represent it by a value `PatSynSigSkol n` (instead of incorrect signatures we simply print no explicit signature). Furthermore, we rename `PatSynCtxt` to `PatSynBuilderCtxt`, and use `SigSkol (PatSynBuilderCtxt n) (Check ty)` to represent the type of a bidirectional pattern synonym when used in an expression context. Before, this type was represented by a value `SigSkol (PatSynCtxt n) (Check ty)`, which caused incorrect error messages. Also, in `mk_dict_err` of `typecheck\TcErrors.hs` we now distinguish between all enclosing implications and "useful" enclosing implications, for better error messages concerning pattern synonyms. See `Note [Useful implications]`. See the Phabricator page for examples. Reviewers: mpickering, goldfire, simonpj, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1967 GHC Trac Issues: #11667 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11667#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler