#3297: Compiler panic on incorrect code (TcTyFuns.flattenType: synonym family 
in a
rank-n type)
----------------------------------------+-----------------------------------
    Reporter:  hesselink                |        Owner:  chak        
        Type:  bug                      |       Status:  new         
    Priority:  low                      |    Milestone:  7.2.1       
   Component:  Compiler (Type checker)  |      Version:  6.11        
    Keywords:                           |     Testcase:              
   Blockedby:                           |   Difficulty:  Unknown     
          Os:  Linux                    |     Blocking:              
Architecture:  x86                      |      Failure:  None/Unknown
----------------------------------------+-----------------------------------

Comment(by hesselink):

 I just tested this with GHC 7.0.2, and the compiler panic is gone. I now
 get two type errors instead, which is much better. The errors are below.

 {{{
 Temp.hs:13:9:
     Occurs check: cannot construct the infinite type:
       uf0
       =
       Es (PF (forall n. uf0 n) (Es (forall n. uf0 n)) (forall n. uf0 n))
     Expected type: forall n. Es a n
       Actual type: forall n. uf0 n
     Expected type: (forall n. Es a n) -> a
       Actual type: (forall n. uf0 n)
                    -> PF (forall n. uf0 n) (Es (forall n. uf0 n)) (forall
 n. uf0 n)
     In the expression: from
     In an equation for `crash': crash = from

 Temp.hs:13:9:
     Couldn't match type `a'
                    with `PF
                            (forall n. uf0 n) (Es (forall n. uf0 n))
 (forall n. uf0 n)'
       `a' is a rigid type variable bound by
           the type signature for crash :: (forall n. Es a n) -> a
           at Temp.hs:13:1
     Expected type: (forall n. Es a n) -> a
       Actual type: (forall n. uf0 n)
                    -> PF (forall n. uf0 n) (Es (forall n. uf0 n)) (forall
 n. uf0 n)
     In the expression: from
     In an equation for `crash': crash = from
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3297#comment:9>
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