Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
83852ab2
Commit
83852ab2
authored
Sep 05, 2005
by
simonpj
Browse files
[project @ 2005-09-05 15:20:05 by simonpj]
Add a couple of tests
parent
6a7e59e3
Changes
6
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/typecheck/should_fail/all.T
View file @
83852ab2
...
...
@@ -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
,
[''])
testsuite/tests/ghc-regress/typecheck/should_fail/tcfail149.hs
0 → 100644
View file @
83852ab2
module
Main
where
class
C
a
where
op
::
(
Show
a
,
Show
b
)
=>
a
->
b
->
String
-- This class op adds a constraint on 'a'
testsuite/tests/ghc-regress/typecheck/should_fail/tcfail149.stderr
0 → 100644
View file @
83852ab2
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'
testsuite/tests/ghc-regress/typecheck/should_run/all.T
View file @
83852ab2
...
...
@@ -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
,
[''])
testsuite/tests/ghc-regress/typecheck/should_run/tcrun037.hs
0 → 100644
View file @
83852ab2
{-# 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
))
}
testsuite/tests/ghc-regress/typecheck/should_run/tcrun037.stdout
0 → 100644
View file @
83852ab2
True 'x'
False 3
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment