[GHC] #15247: Use empty types for TTG extension constructors

GHC ghc-devs at haskell.org
Fri Jun 8 20:11:02 UTC 2018


#15247: Use empty types for TTG extension constructors
-------------------------------------+-------------------------------------
        Reporter:  adamgundry        |                Owner:  (none)
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.5
      Resolution:                    |             Keywords:  TTG
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 alanz):

 I just tried this, and it seems the additional match is still required. I
 end up with

 {{{#!hs
 compiler/hsSyn/HsTypes.hs:1286:1: error: [-Wincomplete-patterns, -Werror
 =incomplete-patterns]
     Pattern match(es) are non-exhaustive
     In an equation for ‘unambiguousFieldOcc’:
         Patterns not matched: (XAmbiguousFieldOcc _)
      |
 1286 | unambiguousFieldOcc (Unambiguous rdr sel) = FieldOcc rdr sel
 }}}

 having removed the last line of

 {{{#!hs
 unambiguousFieldOcc :: AmbiguousFieldOcc GhcTc -> FieldOcc GhcTc
 unambiguousFieldOcc (Unambiguous rdr sel) = FieldOcc rdr sel
 unambiguousFieldOcc (Ambiguous   rdr sel) = FieldOcc rdr sel
 unambiguousFieldOcc (XAmbiguousFieldOcc _) = panic "unambiguousFieldOcc"
 }}}

 Perhaps I misunderstand how this is intended to work?

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


More information about the ghc-tickets mailing list