Bug in Hugs Dec 2001: type inferencer incorrect!

Rijk J. C. van Haaften Rijk J. C. van Haaften" <rjchaaft@cs.uu.nl
Thu, 07 Mar 2002 09:16:36 +0100


Hello everybody,

Although I didn't manage to reproduce the
bug with a minimal example, I think it is
still important enough to tell you (and
especially the Hugs writers and maintainers)=2E

Yesterday evening, I tried to add some correct
(!) code (by-hand-verifyable; by GHC accepted;
just using plain Haskell 98) to one of the
projects I'm working on=2E

Hugs however said this:
Type checking
ERROR "TypeInferDecls=2Ehs":102 - Type error in application
*** Expression     : checkedUnify (snd newTyEnv) inferredHpPtr explicitHpP=
tr (\t1 t2 ue -> ([l],ExplicitError n t1 t2 ue))
*** Term           : checkedUnify
*** Type           : NonGenerics -> HpPtr -> HpPtr -> ErrorFunction -> TI =
Error ()
*** Does not match : a -> b -> c -> d -> e
*** Because        : types do not match

I've read this ten times, checked my code
looking whether I were doing strange things,
but I can only conclude:
This is, even without a minimal example,
clearly a bug: the types do match=2E

Moreover, the bug is reported about a completely
different part of the file (relative to the location
I edited), in code almost unrelated to the code
I added (about line 300)=2E

I have explicit types everywhere in that file,
so if it were wrong, the error should be
reported about line 300=2E So the reporting-place
is wrong (but I don't expect Hugs to report
good error-placement)=2E

Though I didn't manage to write a minimal
example, I hope our Hugs experts are able
to find the bug soon=2E

As a last point: the file is rather big:
726 lines of code, 27KB=2E

Rijk-Jan van Haaften