Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/853c1c3e97dd8bc251c6b56000d7a85a2ca79715

>---------------------------------------------------------------

commit 853c1c3e97dd8bc251c6b56000d7a85a2ca79715
Author: Iavor S. Diatchki <[email protected]>
Date:   Sat Mar 31 12:14:49 2012 -0700

    Add some missing equations for type-literals.

>---------------------------------------------------------------

 compiler/types/Unify.lhs |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/compiler/types/Unify.lhs b/compiler/types/Unify.lhs
index 68a61fd..50a0fcf 100644
--- a/compiler/types/Unify.lhs
+++ b/compiler/types/Unify.lhs
@@ -199,6 +199,8 @@ match menv subst (AppTy ty1a ty1b) ty2
   = do { subst' <- match menv subst ty1a ty2a
        ; match menv subst' ty1b ty2b }
 
+match _ subst (LitTy x) (LitTy y) | x == y  = return subst
+
 match _ _ _ _
   = Nothing
 
@@ -339,6 +341,8 @@ typesCantMatch prs = any (\(s,t) -> cant_match s t) prs
        | Just (f1, a1) <- repSplitAppTy_maybe ty1
        = cant_match f1 f2 || cant_match a1 a2
 
+    cant_match (LitTy x) (LitTy y) = x /= y
+
     cant_match _ _ = False      -- Safe!
 
 -- Things we could add;
@@ -453,6 +457,8 @@ unify subst ty1 (AppTy ty2a ty2b)
   = do { subst' <- unify subst ty1a ty2a
         ; unify subst' ty1b ty2b }
 
+unify subst (LitTy x) (LitTy y) | x == y = return subst
+
 unify _ ty1 ty2 = failWith (misMatch ty1 ty2)
        -- ForAlls??
 



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to