Opened 3 years ago

Closed 3 years ago

#12638 closed bug (duplicate)

GHC panic when resolving Show instance

Reported by: MichaelK Owned by:
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 8.0.1
Keywords: PolyKinds, TypeFamilies Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #12041 Differential Rev(s):
Wiki Page:


I'm playing around with rolling my own type defaulting and found a panic. Note: adding a stub Show (W a) instance resolves this (i.e. show _ = "test").

{- Test.hs -}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}

module Test where

import Data.Proxy

data W (a :: k) = Wk | W (MkStar a)

type family MkStar (a :: k) :: *

main = print (W Proxy :: W (Proxy (~)))
$ ghc Test.hs -o test 
[1 of 1] Compiling Test             ( Test.hs, Test.o )

Test.hs:13:8: error:ghc: panic! (the 'impossible' happened)
  (GHC version 8.0.1 for x86_64-apple-darwin):
	print_equality ~

Please report this as a GHC bug:

If x = W Proxy :: W (Proxy (~)) is only defined, there is no issue. It seems to occur exactly when resolving a Show instance for W (Proxy (~)) and one does not exist.

Change History (1)

comment:1 Changed 3 years ago by mpickering

Resolution: duplicate
Status: newclosed

This is fixed on the master branch and 8.0 branch. Thanks for the report!

Note: See TracTickets for help on using tickets.