Opened 5 years ago

Closed 5 years ago

#7681 closed bug (fixed)

Panic on quoting empty case

Reported by: monoidal Owned by:
Priority: normal Milestone:
Component: Template Haskell Version: 7.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


With -XEmptyCase on,

Prelude Language.Haskell.TH> runQ [| case 0 of {} |]
ghc: panic! (the 'impossible' happened)
  (GHC version 7.7.20130209 for x86_64-unknown-linux):
	coreList: empty argument

Change History (3)

comment:1 Changed 5 years ago by monoidal

Component: CompilerTemplate Haskell

Splicing does not work, either:

Prelude Language.Haskell.TH> $(return $ CaseE (LitE (IntegerL 0)) [])

    Case expression with no alternatives
    When splicing a TH expression: case 0 of
    In the expression: $(return $ CaseE (LitE (IntegerL 0)) [])
    In an equation for `it':
        it = $(return $ CaseE (LitE (IntegerL 0)) [])

comment:2 Changed 5 years ago by eir@…

commit 7b098b6009727a012cb1f3ff0ca51698d302cae1

Author: Richard Eisenberg <>
Date:   Mon Feb 11 23:07:25 2013 -0500

    Fix Trac #7681.
    Removed checks for empty lists for case expressions and lambda-case.
    If -XEmptyCase is not enabled, compilation still fails (appropriately)
    in the renamer.
    Had to remove dead code from TrieMap to pass the validator.

 compiler/coreSyn/TrieMap.lhs |   38 +-------------------------------------
 compiler/deSugar/DsMeta.hs   |    6 ++++--
 compiler/hsSyn/Convert.lhs   |    8 ++------
 libraries/random             |    2 +-
 4 files changed, 8 insertions(+), 46 deletions(-)

comment:3 Changed 5 years ago by goldfire

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.