Type-checker bug related to implicit parameters.

Simon Peyton-Jones simonpj@microsoft.com
Thu, 20 Sep 2001 01:24:13 -0700


GHC 5.02 works fine for this program.  We're going to release it this
week.

Thanks for the test -- I've added it to our test suite!

Simon

| -----Original Message-----
| From: John Hughes [mailto:rjmh@cs.chalmers.se]=20
| Sent: 19 September 2001 18:00
| To: hugs-bugs@haskell.org
| Subject: Type-checker bug related to implicit parameters.
|=20
|=20
|=20
| Hugs -98 (Feb 2001) rejects the following program (which=20
| should be well-typed)
|=20
| > foo :: ((?x :: Int) =3D> b) -> Int -> b
| > foo s z =3D s with ?x =3D z
|=20
| with the message
|=20
| ERROR Bug.hs:2 - Inferred type is not general enough
| *** Expression    : foo
| *** Expected type : ((?x :: Int) =3D> a) -> Int -> a
| *** Inferred type : ((?x :: Int) =3D> a) -> Int -> Int
|=20
| It seems to unify the type of the implicit parameter with the=20
| type of the result.
|=20
| GHC accepts this program (but generates wrong code).
|=20
| John Hughes
|=20
| _______________________________________________
| Hugs-Bugs mailing list
| Hugs-Bugs@haskell.org=20
| http://www.haskell.org/mailman/listinfo/hugs-bugs
|=20