Type checking (implict parameters) bug

Iavor S. Diatchki diatchki@cse.ogi.edu
Wed, 15 Jan 2003 18:25:07 -0800


{-
Hello,

I seem to have run into a bug in the Hugs type checker.
Bellow are three variations of the problem, with the errors that Hugs 
came up with.
I used the version of Hugs from cvs (January 2003) (just checked it 
out), and it also seems
to happen on the Nov 2002 version.  The tests were done on a machine 
running Mandrake Linux 9.0.

The 1st and the 3rd program are incorrect (GHC says unbound implicit 
parameter, as expected),
while the 2nd one should be ok.

bye
Iavor
-}



-- Type checking
-- INTERNAL ERROR: getKind
--
-- f :: a -> ((?depth::Int) => b) -> b
-- f x y = y


-- Type checking
-- ... loops ...
--
-- f :: a -> ((?depth::Int) => b) -> b
-- f x y = let ?depth = 1 in y


-- Type checking
-- ERROR "test.hs":16 - Inferred type is not general enough
-- *** Expression    : f
-- *** Expected type : Show a => b -> ((?depth :: Int) => a) -> a
-- *** Inferred type : Show a => a -> ((?depth :: Int) => a) -> a
--
-- f :: Show b => a -> ((?depth::Int) => b) -> b
-- f x y = y



-- 
==================================================
| Iavor S. Diatchki, Ph.D. student               |
| Department of Computer Science and Engineering |
| School of OGI at OHSU                          |
| http://www.cse.ogi.edu/~diatchki               |
==================================================