Ticket #7386 (closed bug: fixed)

Opened 7 months ago

Last modified 6 months ago

Panic "tcTyVarDetails" in GHCi when :forcing a data family instance

Reported by: goldfire Owned by:
Priority: normal Milestone:
Component: GHCi Version: 7.6.1
Keywords: PolyKinds Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHCi crash Difficulty: Unknown
Test Case: ghci.debugger/scripts/T7386 Blocked By:
Blocking: Related Tickets:

Description

I loaded the following code into GHCi:

{-# LANGUAGE GADTs, DataKinds, KindSignatures, TypeFamilies, PolyKinds #-}

data Nat = Zero | Succ Nat
data family Sing (a :: k)
data instance Sing (a :: Nat) where
  SZero :: Sing Zero
  SSucc :: Sing n -> Sing (Succ n)

Then. I run these commands at the prompt:

*Main> let x = SSucc SZero
*Main> :f x

The response is

ghc: panic! (the 'impossible' happened)
  (GHC version 7.7.20121031 for x86_64-apple-darwin):
	tcTyVarDetails
<<details unavailable>>

Change History

Changed 6 months ago by simonpj@…

commit acbe5265d053e6497626f12f49f38aa31ff730e5

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Tue Nov 6 15:55:39 2012 +0000

    Fix the instantiation of data constructors in the GHCi debugger
    
    This bug caused Trac #7386, because in the (rather tricky) "type
    inference" (aka run time type reconstruction) done by the GHCi
    debugger, we were failing to instantiate a data type family
    correctly.  When that code was written we didn't *have* data
    families.
    
    I wrote Note [Constructor arg types] to explain the new scheme.

 compiler/ghci/RtClosureInspect.hs |   39 ++++++++++++++++++++++++++++++++----
 1 files changed, 34 insertions(+), 5 deletions(-)

Changed 6 months ago by simonpj

  • status changed from new to merge
  • difficulty set to Unknown
  • testcase set to ghci.debugger/scripts/T7386

Thanks; I've fixed this. Merge to 7.6 branch.

Simon

Changed 6 months ago by igloo

  • status changed from merge to closed
  • resolution set to fixed

Merged as c41ca7980664c73cfbd27b0d9f9c081ecf7dc25c

Note: See TracTickets for help on using tickets.