From 371d661d6fcdae01b6b4f04b916a842e9fe7fc76 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Tue, 3 Mar 2009 17:42:58 +0000 Subject: [PATCH] Fix Trac #3066: checking argument types in foreign calls When checking argument types in a foreign call we were stupidly looking through foralls. The fix is easy. Merge to 6.10.2 --- compiler/typecheck/TcType.lhs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/typecheck/TcType.lhs b/compiler/typecheck/TcType.lhs index e0e7649..d6dbf1c 100644 --- a/compiler/typecheck/TcType.lhs +++ b/compiler/typecheck/TcType.lhs @@ -1268,8 +1268,9 @@ checkRepTyCon :: (TyCon -> Bool) -> Type -> Bool -- newtype T = MkT (Ptr T) -- and wanted it to work... checkRepTyCon check_tc ty - | Just (tc,_) <- splitTyConApp_maybe (repType ty) = check_tc tc - | otherwise = False + | Just (ty', _) <- splitNewTypeRepCo_maybe ty = checkRepTyCon check_tc ty' + | Just (tc,_) <- splitTyConApp_maybe ty = check_tc tc + | otherwise = False checkRepTyConKey :: [Unique] -> Type -> Bool -- Like checkRepTyCon, but just looks at the TyCon key -- 1.7.10.4