[GHC] #3190: Type checker fails to unify/expand type definitions in certain contexts

GHC trac at galois.com
Fri Apr 24 08:51:46 EDT 2009


#3190: Type checker fails to unify/expand type definitions in certain contexts
----------------------+-----------------------------------------------------
Reporter:  ferridder  |          Owner:                         
    Type:  bug        |         Status:  new                    
Priority:  normal     |      Component:  Compiler (Type checker)
 Version:  6.10.2     |       Severity:  minor                  
Keywords:             |       Testcase:                         
      Os:  Windows    |   Architecture:  Unknown/Multiple       
----------------------+-----------------------------------------------------
 When compiling

 type TMvar a = TVar (Maybe a)
 mynewEmptyMvar :: STM (TMVar a)
 mynewEmptyMvar = newTVar Nothing

 the type checker complains

     Couldn't match expected type `TMVar a'
            against inferred type `TVar (Maybe a1)'
       Expected type: STM (TMVar a)
       Inferred type: STM (TVar (Maybe a1))
     In the expression: newTVar Nothing
     In the definition of `mynewEmptyMvar':
         mynewEmptyMvar = newTVar Nothing

 although the definition of TMvar is
 type TMvar a = TVar (Maybe a)

 This behaviour could not be duplicated in the IO monad.

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


More information about the Glasgow-haskell-bugs mailing list