Ticket #5978 (closed bug: fixed)
Type error in one function causes wrong type error report in another function in the presence of functionally dependent types
| Reported by: | Lemming | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 7.6.1 |
| Component: | Compiler (Type checker) | Version: | 7.4.1 |
| Keywords: | Cc: | dimitris@… | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | GHC rejects valid program | Difficulty: | Unknown |
| Test Case: | typecheck/should_fail/T5978 | Blocked By: | |
| Blocking: | Related Tickets: |
Description
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.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

