Commit a13e5337 authored by simonpj's avatar simonpj

[project @ 2004-10-08 14:00:58 by simonpj]

Add a test
parent 80dfc397
......@@ -191,3 +191,4 @@ test('tc178', normal, compile, [''])
test('tc179', normal, compile, [''])
test('tc180', normal, compile, [''])
test('tc181', normal, compile, [''])
test('tc182', normal, compile, [''])
{-# OPTIONS -fglasgow-exts #-}
-- Tests the "stupid theta" in pattern-matching
-- when there's an existential as well
module ShouldCompile where
data (Show a) => Obs a = forall b. LiftObs a b
f :: Show a => Obs a -> String
f (LiftObs _ _) = "yes"
......@@ -110,3 +110,4 @@ test('tcfail121', normal, compile_fail, [''])
test('tcfail122', normal, compile_fail, [''])
test('tcfail123', normal, compile_fail, [''])
test('tcfail124', normal, compile_fail, [''])
test('tcfail125', normal, compile_fail, [''])
{-# OPTIONS -fglasgow-exts #-}
-- Tests the "stupid theta" in pattern-matching
-- when there's an existential as well
module ShouldCompile where
data (Show a) => Obs a = forall b. LiftObs a b
f :: Obs a -> String -- Needs a (Show a) context
f (LiftObs _ _) = "yes"
tcfail125.hs:11:3:
No instance for (Show a)
arising from use of `LiftObs' at tcfail125.hs:11:3-13
Probable fix: Add (Show a) to the type signature(s) for `f'
In the definition of `f': f (LiftObs _ _) = "yes"
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