GHC: Ticket #1223: ghc-6.6: panic! (the 'impossible' happened)
http://ghc.haskell.org/trac/ghc/ticket/1223
<p>
ghc-6.6: panic! (the 'impossible' happened)
</p>
<blockquote>
<p>
(GHC version 6.6 for i386-apple-darwin):
</p>
<blockquote>
<p>
checkKind: adding kind constraint
</p>
</blockquote>
<p>
t{tv a2M5} [tv] *
t_a1pL{tv} [tau] t_a1pL{tv} [tau] ??
</p>
</blockquote>
<p>
Please report this as a GHC bug: <a href="http://www.haskell.org/ghc/reportabug">http://www.haskell.org/ghc/reportabug</a>
</p>
<p>
(Note I have a tar.gz with the offending code but it's not obvious how to attach a file to this ticket. If I can do it then I will upload the code and remove this note.)
</p>
en-usGHChttp://ghc.haskell.org/trac/ghc/chrome/site/ghc_logo.png
http://ghc.haskell.org/trac/ghc/ticket/1223
Trac 1.2.2guestWed, 14 Mar 2007 02:55:04 GMTattachment set
http://ghc.haskell.org/trac/ghc/ticket/1223
http://ghc.haskell.org/trac/ghc/ticket/1223
<ul>
<li><strong>attachment</strong>
set to <em>panic.tar.gz</em>
</li>
</ul>
<p>
offending code with a buildscript (ghc --make yada yada) that causes ghc panic
</p>
TicketsimonpjWed, 14 Mar 2007 11:40:50 GMTstatus changed; resolution set
http://ghc.haskell.org/trac/ghc/ticket/1223#comment:1
http://ghc.haskell.org/trac/ghc/ticket/1223#comment:1
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
</ul>
<p>
OK I've looked into this. I boiled it down a bit to a single file (see new below).
</p>
<p>
The problem turned out to be something to do with "linear implicit parameters", which are a heavily deprecated feature of GHC 6.6, and are removed altogether in the HEAD. In Era.hs we find things like "1%n", and the "%n" was interpreted as a linear implicit parameter.
</p>
<p>
Of course this still should not trigger a crash.
</p>
<p>
The 6.6 release notes advertised the linear implicit parameters might well vanish from 6.6.1, and this seems a good moment to do so. I'm going to take them out of the parser only.
</p>
<p>
I'll patch the branch directly; the HEAD is fine.
</p>
<p>
Simon
</p>
<p>
Here's my cut-down code:
</p>
<pre class="wiki">module Era where
import Ratio
import Char
import Numeric (readDec, readSigned)
data CR = CR_ (Int -> Integer)
instance Eq CR where
instance Show CR where
instance Ord CR where
instance Num CR where
instance Fractional CR where
instance Floating CR where
log_drx :: CR -> CR
log_drx = power_series [1%n | n <- [1..]] (+1)
acc_seq :: (Rational -> Integer -> Rational) -> [Rational]
acc_seq f = scanl f (1%1) [1..]
exp_dr :: CR -> CR
exp_dr = power_series (acc_seq (\a n -> a*(1%n))) id
power_series :: [Rational] -> (Int -> Int) -> CR -> CR
power_series = error "urk"
</pre>
Ticket