Commit ac3877cc authored by Simon Peyton Jones's avatar Simon Peyton Jones

Add tests for Trac #4436, #4439

parent 2470c32b
{-# LANGUAGE ViewPatterns, ExistentialQuantification #-}
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
-- None of these should give incomplete-pattern warnings
module T4439 where
data Moo = Moo (Char -> Int)
spqr (Moo _) = undefined
foo (id -> Moo _) = undefined
data Exists = forall a. Exists (a -> Int)
bar (Exists _) = undefined
baz (id -> Exists _) = undefined
...@@ -75,3 +75,4 @@ test('T3263-2', if_compiler_lt('ghc', '6.11', expect_fail), compile, ['-fwarn-wr ...@@ -75,3 +75,4 @@ test('T3263-2', if_compiler_lt('ghc', '6.11', expect_fail), compile, ['-fwarn-wr
test('GadtOverlap', normal, compile, ['-Wall']) test('GadtOverlap', normal, compile, ['-Wall'])
test('T2395', normal, compile, ['']) test('T2395', normal, compile, [''])
test('T4371', normal, compile, ['']) test('T4371', normal, compile, [''])
test('T4439', normal, compile, [''])
{-# OPTIONS -XTemplateHaskell #-}
module TH( x ) where
import Language.Haskell.TH
x = $(return (LitE (StringL "hello\ngoodbye\nand then")))
T4436.hs:5:7-56: Splicing expression
return
(LitE
(StringL
"hello\
\goodbye\
\and then"))
======>
"hello\
\goodbye\
\and then"
...@@ -176,4 +176,5 @@ test('T4233', normal, compile, ['-v0']) ...@@ -176,4 +176,5 @@ test('T4233', normal, compile, ['-v0'])
test('T4169', normal, compile, ['-v0']) test('T4169', normal, compile, ['-v0'])
test('T1835', normal, compile_and_run, ['-v0']) test('T1835', normal, compile_and_run, ['-v0'])
test('TH_viewPatPrint', normal, compile_and_run, ['']) test('TH_viewPatPrint', normal, compile_and_run, [''])
\ No newline at end of file test('T4436', normal, compile, ['-v0 -ddump-splices'])
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