[GHC] #14055: Panic on type error inside a type-level newtype (was: Panic on type error inside a type-level newtype (with -XTypeInType))

GHC ghc-devs at haskell.org
Sat Jul 29 20:18:13 UTC 2017


#14055: Panic on type error inside a type-level newtype
-------------------------------------+-------------------------------------
        Reporter:  luqui             |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  MacOS X           |         Architecture:  x86_64
 Type of failure:  Compile-time      |  (amd64)
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by luqui:

Old description:

> {{{#!hs
> {-# LANGUAGE TypeInType, TypeFamilies #-}
>
> newtype X = RollX (() -> X)
>
> type family F t :: X where
>     F t = RollX (t -> ())
> }}}
>
> gives
>
> {{{
> ghc: panic! (the 'impossible' happened)
>   (GHC version 8.2.1 for x86_64-apple-darwin):
>         repSplitAppTys
>   t_a1po[sk:1]
>   ()
>   []
>   Call stack:
>       CallStack (from HasCallStack):
>         prettyCurrentCallStack, called at
> compiler/utils/Outputable.hs:1133:58 in ghc:Outputable
>         callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in
> ghc:Outputable
>         pprPanic, called at compiler/types/Type.hs:808:9 in ghc:Type
> }}}

New description:

 {{{#!hs
 {-# LANGUAGE DataKinds, TypeFamilies #-}

 newtype X = RollX (() -> X)

 type family F t :: X where
     F t = RollX (t -> ())
 }}}

 gives

 {{{
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.2.1 for x86_64-apple-darwin):
         repSplitAppTys
   t_a1po[sk:1]
   ()
   []
   Call stack:
       CallStack (from HasCallStack):
         prettyCurrentCallStack, called at
 compiler/utils/Outputable.hs:1133:58 in ghc:Outputable
         callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in
 ghc:Outputable
         pprPanic, called at compiler/types/Type.hs:808:9 in ghc:Type
 }}}

--

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14055#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list