Ticket #2985 (closed merge: fixed)
Bogus superclass dictionary with equality constraints
| Reported by: | simonpj | Owned by: | igloo |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.10.2 |
| Component: | Compiler | Version: | 6.10.1 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | indexed-types/should_run/T2985 | Blocked By: | |
| Blocking: | Related Tickets: |
Description
{-# LANGUAGE TypeFamilies, UndecidableInstances #-}
{-# OPTIONS -fglasgow-exts -Wnot #-}
module Main where
instance (Num a, Num b, a ~ b) => Num (a,b) where
x * _ = x
test1 = (1,1) * (2,2)
main = print test1
Running this program produces <<loop>>. Reason is that the Num (a,b) dictionary gets an Eq superclass dictionary that is essentially bottom. I'm not sure why, but it's a bad bug.
See http://article.gmane.org/gmane.comp.lang.haskell.general/16796
Simon
Change History
Note: See
TracTickets for help on using
tickets.
