#5978: Type error in one function causes wrong type error report in another
function in the presence of functionally dependent types
---------------------------------------+------------------------------------
Reporter: Lemming | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler (Type
checker)
Version: 7.4.1 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: GHC rejects valid program | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------------+------------------------------------
When trying to reduce my problem in #5970 to a simple program I
encountered an even more obvious bug. The problem is essentially as
follows: I have
{{{
correct :: T
correct = ...
wrong :: T
wrong = f correct
}}}
where 'wrong' has a type error and 'correct' is type correct. If I
outcomment 'wrong' then GHC correctly confirms type-correctness of
'correct', but if 'wrong' is enabled then GHC claims a type error in both
'wrong' and 'correct'.
To me it looks like the type-checker is trying to unify types across
function boundaries. This would explain both non-linear growth of type-
checking time and the observed effect of incorrect type errors.
See attached program for a working example.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5978>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs