From c8923e2df066608a14b05b87eb0440b24c79192f Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 6 Jun 2008 18:46:31 +0000 Subject: [PATCH] Fix a bug in eqPatType One of the conditions we were checking was t2 `eqPatLType` t2 rather than t1 `eqPatLType` t2 --- compiler/typecheck/TcClassDcl.lhs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/typecheck/TcClassDcl.lhs b/compiler/typecheck/TcClassDcl.lhs index 49d2088..dc3f446 100644 --- a/compiler/typecheck/TcClassDcl.lhs +++ b/compiler/typecheck/TcClassDcl.lhs @@ -676,8 +676,8 @@ eqPatType :: HsType Name -> HsType Name -> Bool -- A very simple equality function, only for -- type patterns in generic function definitions. eqPatType (HsTyVar v1) (HsTyVar v2) = v1==v2 -eqPatType (HsAppTy s1 t1) (HsAppTy s2 t2) = s1 `eqPatLType` s2 && t2 `eqPatLType` t2 -eqPatType (HsOpTy s1 op1 t1) (HsOpTy s2 op2 t2) = s1 `eqPatLType` s2 && t2 `eqPatLType` t2 && unLoc op1 == unLoc op2 +eqPatType (HsAppTy s1 t1) (HsAppTy s2 t2) = s1 `eqPatLType` s2 && t1 `eqPatLType` t2 +eqPatType (HsOpTy s1 op1 t1) (HsOpTy s2 op2 t2) = s1 `eqPatLType` s2 && t1 `eqPatLType` t2 && unLoc op1 == unLoc op2 eqPatType (HsNumTy n1) (HsNumTy n2) = n1 == n2 eqPatType (HsParTy t1) t2 = unLoc t1 `eqPatType` t2 eqPatType t1 (HsParTy t2) = t1 `eqPatType` unLoc t2 -- 1.7.10.4