Commit 83852ab2 authored by simonpj's avatar simonpj
Browse files

[project @ 2005-09-05 15:20:05 by simonpj]

Add a couple of tests
parent 6a7e59e3
......@@ -133,3 +133,4 @@ test('tcfail145', normal, compile_fail, [''])
test('tcfail146', normal, compile_fail, [''])
test('tcfail147', normal, compile_fail, [''])
test('tcfail148', normal, compile_fail, [''])
test('tcfail149', normal, compile_fail, [''])
module Main where
class C a where
op :: (Show a, Show b) => a -> b -> String
-- This class op adds a constraint on 'a'
tcfail149.hs:3:0:
All of the type variables in the constraint `Show a' are already in scope
(at least one must be universally quantified here)
When checking the class method:
op :: forall b. (Show a, Show b) => a -> b -> String
In the class declaration for `C'
......@@ -42,6 +42,7 @@ test('tcrun033', only_compiler_types(['ghc']), compile_and_run, [''])
test('tcrun034', only_compiler_types(['ghc']), compile_and_run, [''])
test('tcrun035', only_compiler_types(['ghc']), compile_and_run, [''])
test('tcrun036', only_compiler_types(['ghc']), compile_and_run, [''])
test('tcrun037', only_compiler_types(['ghc']), compile_and_run, [''])
test('church', normal, compile_and_run, [''])
test('testeq2', normal, compile_and_run, [''])
{-# OPTIONS -fglasgow-exts #-}
module Main where
class C a where
op :: (Show a, Show b) => a -> b -> String
-- This class op has local quantification, but
-- also adds a constraint on 'a'
instance C Bool where
op x y = show x ++ " " ++ show y
main = do { putStrLn (op True 'x'); putStrLn (op False (3::Int)) }
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