[GHC] #13752: Odd pattern synonym type errors

GHC ghc-devs at haskell.org
Thu May 25 10:59:26 UTC 2017


#13752: Odd pattern synonym type errors
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       Component:  Compiler (Type    |              Version:  8.2.1-rc2
  checker)                           |             Keywords:
      Resolution:                    |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Simon Peyton Jones <simonpj@…>):

 In [changeset:"c9977385dca9536f18374242f713b1048a38dec5/ghc" c997738/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="c9977385dca9536f18374242f713b1048a38dec5"
 Pattern synonyms and higher rank types

 This patch fixes two separate bugs which contributed to making
 Trac #13752 go wrong

 1.  We need to use tcSubType, not tcUnify,
     in tcCheckPatSynDecl.tc_arg.

     Reason: Note [Pattern synonyms and higher rank types]

 2.  TcUnify.tc_sub_type had a special case designed to improve error
     messages; see Note [Don't skolemise unnecessarily].  But the
     special case was too liberal, and ended up using unification
     (which led to rejecting the program) when it should instead taken
     the normal path (which accepts the program).

     I fixed this by making the test more conservative.
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13752#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list