Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#10248 closed bug (fixed)

GHC panic when used with deferred type errors, again

Reported by: Iceland_jack Owned by:
Priority: normal Milestone:
Component: GHCi Version: 7.10.1-rc3
Keywords: Cc: hvr
Operating System: Linux Architecture: x86
Type of failure: Other Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by Iceland_jack)

Similar to previous report of mine #9834. Given error.hs

data I a = I a

I get the following result:

$ ghci -fdefer-type-errors -ignore-dot-ghci error.hs 
GHCi, version 7.10.0.20150316: http://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Main             ( error.hs, interpreted )
Ok, modules loaded: Main.
*Main> I <$> _
I <$> _

<interactive>:2:7: Warning:
    Found hole _ with type: IO a0
    Where: a0 is an ambiguous type variable
    In the second argument of (<$>), namely _
    In the first argument of GHC.GHCi.ghciStepIO ::
                                IO a_auR -> IO a_auR, namely
      I <$> _
    In a stmt of an interactive GHCi command:
      it <- GHC.GHCi.ghciStepIO :: IO a_auR -> IO a_auR (I <$> _)
ghc: panic! (the 'impossible' happened)
  (GHC version 7.10.0.20150316 for i386-unknown-linux):
        nameModule $dShow_aIT

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

*Main> 

Change History (7)

comment:1 Changed 3 years ago by Iceland_jack

Description: modified (diff)

comment:2 Changed 3 years ago by simonpj

Well that's odd. It works fine in HEAD.

Simon

comment:3 Changed 3 years ago by ion1

I encountered the following on GHC 7.10.1, looks like it might be the same bug:

% ghc -ignore-dot-ghci -fdefer-typed-holes -e 'map (\a b -> undefined) _'

<interactive>:1:25: Warning:
    Found hole ‘_’ with type: [a0]
    Where: ‘a0’ is an ambiguous type variable
    Relevant bindings include
      it :: [t -> t1] (bound at <interactive>:1:1)
    In the second argument of ‘map’, namely ‘_’
    In the expression: map (\ a b -> undefined) _
    In an equation for ‘it’: it = map (\ a b -> undefined) _

<interactive>:1:25: Warning:
    Found hole ‘_’ with type: [a0]
    Where: ‘a0’ is an ambiguous type variable
    Relevant bindings include
      it :: [t -> t2] (bound at <interactive>:1:1)
    In the second argument of ‘map’, namely ‘_’
    In the expression: map (\ a b -> undefined) _
    In an equation for ‘it’: it = map (\ a b -> undefined) _
<interactive>: <interactive>: panic! (the 'impossible' happened)
  (GHC version 7.10.1 for x86_64-unknown-linux):
        nameModule $dShow_aMc

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

comment:4 Changed 3 years ago by Simon Peyton Jones <simonpj@…>

comment:5 Changed 3 years ago by simonpj

Resolution: fixed
Status: newclosed

Seems ok in 7.10 too

comment:6 Changed 3 years ago by Austin Seipp <austin@…>

In 3cf8ecdc70cb295a2b9606080a1c7b5fa8eb16f4/ghc:

Revert multiple commits

This reverts multiple commits from Simon:

  - 04a484eafc9eb9f8774b4bdd41a5dc6c9f640daf Test Trac #10359
  - a9ccd37add8315e061c02e5bf26c08f05fad9ac9 Test Trac #10403
  - c0aae6f699cbd222d826d0b8d78d6cb3f682079e Test Trac #10248
  - eb6ca851f553262efe0824b8dcbe64952de4963d Make the "matchable-given" check happen first
  - ca173aa30467a0b1023682d573fcd94244d85c50 Add a case to checkValidTyCon
  - 51cbad15f86fca1d1b0e777199eb1079a1b64d74 Update haddock submodule
  - 6e1174da5b8e0b296f5bfc8b39904300d04eb5b7 Separate transCloVarSet from fixVarSet
  - a8493e03b89f3b3bfcdb6005795de050501f5c29 Fix imports in HscMain (stage2)
  - a154944bf07b2e13175519bafebd5a03926bf105 Two wibbles to fix the build
  - 5910a1bc8142b4e56a19abea104263d7bb5c5d3f Change in capitalisation of error msg
  - 130e93aab220bdf14d08028771f83df210da340b Refactor tuple constraints
  - 8da785d59f5989b9a9df06386d5bd13f65435bc0 Delete commented-out line

These break the build by causing Haddock to fail mysteriously when
trying to examine GHC.Prim it seems.

comment:7 Changed 3 years ago by Simon Peyton Jones <simonpj@…>

Note: See TracTickets for help on using tickets.