Ticket #1795 (closed bug: fixed)
typechecker loops on simple program with fundep
| Reported by: | guest | Owned by: | simonpj |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.8.1 |
| Component: | Compiler | Version: | 6.8 |
| Keywords: | Cc: | ganesh.sittampalam@… | |
| Operating System: | Unknown/Multiple | Architecture: | x86 |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | FD3 | Blocked By: | |
| Blocking: | Related Tickets: |
Description (last modified by simonpj) (diff)
The program below causes the "Renamer/typechecker" phase to loop. Confirmed with GHC 6.8.20070927 on Linux and 6.9.20071018 on Windows (so I'm not absolutely certain it's present in latest 6.8, but it seems very likely).
The program has an infinite type - the definition of translate causes (String, a) to be unified with a. Removing the fundep in MkA causes a reasonable error to be reported.
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-}
module X() where
data A a = A
class MkA a b | a -> b where
mkA :: a -> A b
instance MkA a a where
translate :: (String, a) -> A a
translate a = mkA a
Ganesh
Change History
Note: See
TracTickets for help on using
tickets.
