Commit e6166f13 authored by simonpj's avatar simonpj

Tests for Trac #2674

parent 3166a385
{-# LANGUAGE TemplateHaskell #-}
-- Trac #2674
module ShouldFail where
import Language.Haskell.TH
$(return [FunD (mkName "foo") []])
T2674.hs:9:2:
Function binding for `foo' has no equations
When splicing generated code into the program
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TemplateHaskell #-}
-- Trac #2431: empty case expression -- Trac #2431: empty case expression
-- currently rejected
module Main where module Main where
......
TH_emptycase: TH_emptycase.hs:9:4-33: Non-exhaustive patterns in case
TH_emptycase.hs:10:6:
Case expression with no alternatives
When splicing generated code into the program
When splicing TH expression: CaseE (LitE (CharL 'a')) []
In the expression: $(caseE (litE $ CharL 'a') [])
In the definition of `f': f = $(caseE (litE $ CharL 'a') [])
...@@ -117,10 +117,11 @@ test('TH_scope', normal, compile, ['']) ...@@ -117,10 +117,11 @@ test('TH_scope', normal, compile, [''])
test('T2632', normal, compile, ['']) test('T2632', normal, compile, [''])
test('T2700', normal, compile, ['-v0']) test('T2700', normal, compile, ['-v0'])
test('T2713', normal, compile_fail, ['-v0']) test('T2713', normal, compile_fail, ['-v0'])
test('T2674', normal, compile_fail, ['-v0'])
test('TH_emptycase', normal, compile_fail, ['-v0'])
test('T2386', extra_clean(['T2386_Lib.hi', 'T2386_Lib.o']), test('T2386', extra_clean(['T2386_Lib.hi', 'T2386_Lib.o']),
run_command, run_command,
['$MAKE -s --no-print-directory T2386'] ) ['$MAKE -s --no-print-directory T2386'] )
test('TH_emptycase', exit_code(1), compile_and_run, [''])
test('T2685', normal, multimod_compile, ['T2685','-v0']) test('T2685', normal, multimod_compile, ['T2685','-v0'])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment