#1722: Code using type synonym families requires workarounds to compile
-------------------------------------------------+--------------------------
 Reporter:  [EMAIL PROTECTED]            |          Owner:  chak       
     Type:  bug                                  |         Status:  closed     
 Priority:  normal                               |      Milestone:  6.10 branch
Component:  Compiler (Type checker)              |        Version:  6.8        
 Severity:  normal                               |     Resolution:  fixed      
 Keywords:                                       |     Difficulty:  Unknown    
 Testcase:  indexed-types/should_compile/GADT12  |   Architecture:  Unknown    
       Os:  Unknown                              |  
-------------------------------------------------+--------------------------
Changes (by chak):

  * testcase:  => indexed-types/should_compile/GADT12
  * status:  new => closed
  * resolution:  => fixed

Comment:

 As expected, the replacement of GADT refinement with equality constraints
 fixed this bug.  More precisely, the test cases `Bug1`, `Bug2A`, and
 `Bug2B` are working now.  The module Bug3 is still rejected:
 {{{
 Code:
     module Bug3 where
     import Defs
     bug :: Expr Typed a -> ()
     bug (Var2 "x" (TypeList TypeBool :: Type [Bool])) = ()
     bug e = ()
 Compilation:
     [1 of 2] Compiling Defs             ( Defs.hs, Defs.o )
     [2 of 2] Compiling Bug3             ( Bug3.hs, Bug3.o )

     Bug3.hs:13:15:
         Couldn't match expected type `a2' against inferred type `[Bool]'
           `a2' is a rigid type variable bound by
            the constructor `Var2' at Bug3.hs:13:5
           Expected type: TU Typed (Type a2)
           Inferred type: Type [Bool]
         In the pattern: TypeList TypeBool :: Type [Bool]
         In the pattern: Var2 "x" (TypeList TypeBool :: Type [Bool])
 }}}
 However, I believe this program is actually incorrect; i.e., GHC
 rightfully rejects it.

 Interestingly, the test cases that I added to the regression test suite
 does trigger a corelint failure.  This is however a different bug; hence,
 I am closing this one.

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