#7128: Panic "lookupVarEnv_NF" when using a functional dependency with a kind
variable
--------------------------------+-------------------------------------------
 Reporter:  goldfire            |          Owner:                               
   
     Type:  bug                 |         Status:  new                          
   
 Priority:  normal              |      Component:  Compiler                     
   
  Version:  7.5                 |       Keywords:  PolyKinds 
FunctionalDependencies
       Os:  Unknown/Multiple    |   Architecture:  Unknown/Multiple             
   
  Failure:  Compile-time crash  |       Testcase:                               
   
Blockedby:                      |       Blocking:                               
   
  Related:                      |  
--------------------------------+-------------------------------------------
 The following code causes a panic:

 {{{
 {-# LANGUAGE PolyKinds, DataKinds, MultiParamTypeClasses,
              FunctionalDependencies
  #-}

 class Foo a (b :: k) | a -> k
 instance Foo Bool False
 }}}

 The error is

 {{{
 ghc-stage2: panic! (the 'impossible' happened)
   (GHC version 7.7.20120807 for x86_64-apple-darwin):
         lookupVarEnv_NF: Nothing
 }}}

 In previous versions of GHC 7.5.x, a functional dependency of this nature
 worked just fine and had the expected behavior of fixing the value of
 {{{k}}} once {{{a}}} was known. It's unclear to me whether this should
 compile or not, but it shouldn't cause a panic. I believe that my code
 that used the functional dependency could use {{{a -> b}}} in place of
 {{{a -> k}}} with no ill effect, so turning this into an error is not a
 problem.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to