[GHC] #14246: Probably AllowAmbiguousTypes + UndecidableInstances + TypeInType

GHC ghc-devs at haskell.org
Mon Sep 18 03:12:56 UTC 2017


#14246: Probably AllowAmbiguousTypes + UndecidableInstances + TypeInType
-------------------------------------+-------------------------------------
           Reporter:  Toricon        |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.2
           Keywords:                 |  Operating System:  Windows
       Architecture:  x86_64         |   Type of failure:  Compile-time
  (amd64)                            |  crash or panic
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 ghc.exe: panic! (the 'impossible' happened)
   (GHC version 8.0.2 for x86_64-unknown-mingw32):
         isInjectiveTyCon sees a TcTyCon KLN

 {{{#!hs

 {-# LANGUAGE RankNTypes, GADTs, TypeOperators, PolyKinds, DataKinds,
 TypeFamilies, AllowAmbiguousTypes, UndecidableInstances, TypeInType #-}

 module MCS.Function where

 import MCS.Core
 --import MCS.Value
 import Data.Kind -- necessary for *

 type family KLN (n :: k) :: Nat where
     KLN (f :: v -> k) = S (KLN (forall t. f t))
     KLN (f :: *) = Z

 type family Reveal (n :: k) (l :: Vect (KLN n) L) :: * where
     Reveal (f :: v -> k) (Cons (Label (t :: v)) l) = Reveal (f t) l
     Reveal (a :: *) Nil = a
 }}}

 The problem *has* to be somewhere in the KLN / Reveal interaction, so I
 removed everything else for this. Every other weird area is commented out
 or unused, and the bug vanished when KLN / Reveal was commented out. KLN
 shouldn't even work. If it _could_ be interaction with the rest of the
 document, I'll put that back in.

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


More information about the ghc-tickets mailing list