#5990: Malformed instance declaration produces panic
--------------------------------+-------------------------------------------
 Reporter:  ChrisN              |          Owner:                               
               
     Type:  bug                 |         Status:  new                          
               
 Priority:  normal              |      Component:  Compiler (Parser)            
               
  Version:  7.5                 |       Keywords:  malformed instance , pars, 
renamer, RnSource
       Os:  Unknown/Multiple    |   Architecture:  Unknown/Multiple             
               
  Failure:  Compile-time crash  |       Testcase:                               
               
Blockedby:                      |       Blocking:                               
               
  Related:                      |  
--------------------------------+-------------------------------------------
 The following code produces a panic with 7.5:
 {{{
 module Test where

 class F a b where
         f ::  a b Int

 instance F -> b  where
         f _ = 1


 }}}

 whereas this code works as expected:


 {{{
 {-# LANGUAGE MultiParamTypeClasses , FlexibleInstances#-}
 module Test where

 class F a b where
         f ::  a b Int

 instance F (->) b  where
         f _ = 1

 }}}

 GHC 7.2.2 correctly identifies this as a malformed instance header.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to