Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jberryman
GHC
Commits
5a3d608f
Commit
5a3d608f
authored
May 03, 2001
by
simonpj
Browse files
[project @ 2001-05-03 08:52:52 by simonpj]
Add a fundep fail test
parent
fec20b7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
ghc/tests/typecheck/should_fail/tcfail093.hs
0 → 100644
View file @
5a3d608f
{-# OPTIONS -fglasgow-exts #-}
module
ShouldFail
where
-- A stripped down functional-dependency
-- example that causes GHC 4.08.1 to crash with:
-- "basicTypes/Var.lhs:194: Non-exhaustive patterns in function readMutTyVar"
-- Reported by Thomas Hallgren Nov 00
primDup
::
Int
->
IO
Int
primDup
=
undefined
dup
()
=
call
primDup
-- call :: Call c h => c -> h
--
-- call primDup :: {Call (Int -> IO Int) h} => h with
-- Using the instance decl gives
-- call primDup :: {Call (IO Int) h'} => Int -> h'
-- The functional dependency means that h must be constant
-- Hence program is rejected because it can't find an instance
-- for {Call (IO Int) h'}
class
Call
c
h
|
c
->
h
where
call
::
c
->
h
instance
Call
c
h
=>
Call
(
Int
->
c
)
(
Int
->
h
)
where
call
f
=
call
.
f
ghc/tests/typecheck/should_fail/tcfail093.stderr
0 → 100644
View file @
5a3d608f
tcfail093.hs:14:
No instance for `Call (IO Int) h'
arising from use of `call' at tcfail093.hs:14
In the definition of `dup': call primDup
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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