diff options
author | Tom Schrijvers <tom.schrijvers@cs.kuleuven.be> | 2007-09-06 17:17:03 +0000 |
---|---|---|
committer | Tom Schrijvers <tom.schrijvers@cs.kuleuven.be> | 2007-09-06 17:17:03 +0000 |
commit | d22b4d8cfaea21a7eb47ec452618769313c1df93 (patch) | |
tree | d2ad651ac6970c88fdbf2467caace0226a4f3c8f | |
parent | e34157d4abd4b82d9b5c32035946edcd22c235b6 (diff) | |
download | haskell-d22b4d8cfaea21a7eb47ec452618769313c1df93.tar.gz |
fix for Simple9
No longer include non-indexed arguments
in lookup of matching type function clause.
By including non-indexed (additional) arguments,
the lookup always fails.
-rw-r--r-- | compiler/typecheck/TcTyFuns.lhs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/typecheck/TcTyFuns.lhs b/compiler/typecheck/TcTyFuns.lhs index fc1906172d..f8bf40e19b 100644 --- a/compiler/typecheck/TcTyFuns.lhs +++ b/compiler/typecheck/TcTyFuns.lhs @@ -68,15 +68,19 @@ tcUnfoldSynFamInst (TyConApp tycon tys) | not (isOpenSynTyCon tycon) -- unfold *only* _synonym_ family instances = return Nothing | otherwise - = do { maybeFamInst <- tcLookupFamInst tycon tys + = do { -- we only use the indexing arguments for matching, not the additional ones + maybeFamInst <- tcLookupFamInst tycon idxTys ; case maybeFamInst of Nothing -> return Nothing - Just (rep_tc, rep_tys) -> return $ Just (mkTyConApp rep_tc rep_tys, - mkTyConApp coe_tc rep_tys) + Just (rep_tc, rep_tys) -> return $ Just (mkTyConApp rep_tc (rep_tys ++ restTys), + mkTyConApp coe_tc (rep_tys ++ restTys)) where coe_tc = expectJust "TcTyFun.tcUnfoldSynFamInst" (tyConFamilyCoercion_maybe rep_tc) } + where + n = tyConArity tycon + (idxTys, restTys) = splitAt n tys tcUnfoldSynFamInst _other = return Nothing \end{code} |