Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic with GHC.TypeLits #58

Open
vladfi1 opened this issue Nov 14, 2015 · 1 comment
Open

Panic with GHC.TypeLits #58

vladfi1 opened this issue Nov 14, 2015 · 1 comment

Comments

@vladfi1
Copy link

vladfi1 commented Nov 14, 2015

The following short program caused a panic:

{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleContexts #-}

module Panic where

import GHC.TypeLits

type family TypeTable (s :: Symbol) :: k

class (KnownNat (Index t), t ~ TypeTable (Index t)) => Typeable t where
  type Index t :: Symbol

Here's the result:

Panic.hs:12:18: error:ghc: panic! (the 'impossible' happened)
  (GHC version 7.11.20151105 for x86_64-unknown-linux):
    AThing evaluated unexpectedly tcTyVar Index

The issue is that I accidentally used KnownNat instead of KnownSymbol.

@goldfirere
Copy link
Owner

Thanks for the report! My understanding is that this panic should happen only with type-incorrect code. It will be fixed, but if you ever see it, you know your code has a bug somewhere. (Not all that helpful, I know!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants