[GHC] #10498: "if ... then \case -> else ..." causes a "missing else clause" error

GHC ghc-devs at haskell.org
Sun Jun 7 04:33:16 UTC 2015


#10498: "if ... then \case -> else ..." causes a "missing else clause" error
-------------------------------------+-------------------------------------
              Reporter:              |             Owner:
  dramforever                        |            Status:  new
                  Type:  bug         |         Milestone:
              Priority:  normal      |           Version:  7.10.1
             Component:  Compiler    |  Operating System:  Unknown/Multiple
  (Parser)                           |   Type of failure:  Other
              Keywords:              |        Blocked By:
          Architecture:              |   Related Tickets:
  Unknown/Multiple                   |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 The following program:

 {{{#!hs
 {-# LANGUAGE LambdaCase #-}

 foo =
     if True
     then
         \case ->
             1 -> 2
     else id
 }}}

 Produces this message:

 {{{
 problem.hs:4:5:
     parse error in if statement: missing required else clause
 }}}

 The problem in the code is that there's a -> after the \case.

 I don't know if a better error message can be generated, but this one is
 really unhelpful.

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


More information about the ghc-tickets mailing list