Ticket #1865 (closed bug: duplicate)
GHCi debugger crashes with :print
| Reported by: | cdsmith@… | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.8.2 |
| Component: | GHCi | Version: | 6.9 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
To reproduce:
1. Enter the following code into a source file:
{-# LANGUAGE NoMonomorphismRestriction #-}
d (i, j) = i + j
dmerge xs [] = xs
dmerge [] ys = ys
dmerge (x:xs) (y:ys) | d x < d y = x : dmerge xs (y:ys)
| d x == d y = x : dmerge xs ys
| otherwise = y : dmerge (x:xs) ys
pairs xs = head xs : pairs (tail xs `dmerge` map (\(i,j) -> (i+1,j+1)) xs
`dmerge` map (\(i,j) -> (i, j+1)) xs)
allpairs = pairs [(1,2)]
2. Start ghci, and pass this file as a parameter.
3. Type :print allpairs
GHCi will crash.
cdsmith@devtools:~/haskell/projects/euler$ ghci -ignore-dot-ghci BugTest.hs
GHCi, version 6.9.20071101: http://www.haskell.org/ghc/ :? for help
Loading package base ... linking ... done.
[1 of 1] Compiling Main ( BugTest.hs, interpreted )
Ok, modules loaded: Main.
*Main> :print allpairs
*** Exception: ghci/Debugger.hs:84:11-72: Irrefutable pattern failed for pattern Data.Maybe.Just subst
ghc-6.9.20071101: panic! (the 'impossible' happened)
(GHC version 6.9.20071101 for i386-unknown-linux):
ghci/Debugger.hs:84:11-72: Irrefutable pattern failed for pattern Data.Maybe.Just subst
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Note that it does not crash without the LANGUAGE directive, so this appears to have something to do with the polymorphic type.
cdsmith@devtools:~/haskell/projects/euler$ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.9.20071101
Change History
Note: See
TracTickets for help on using
tickets.
