X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcodeGen%2FClosureInfo.lhs;h=e6319898db041ba7662eba5eb9967c7964636fab;hb=b88025eabcd83f65d1d81f09272f5172f06a60e7;hp=8f62bc7e0e2a3b99db27f9e1a6c4014dc8ba41b8;hpb=41c97fdcffd38949f89af8094a9f60203b189531;p=ghc-hetmet.git diff --git a/compiler/codeGen/ClosureInfo.lhs b/compiler/codeGen/ClosureInfo.lhs index 8f62bc7..e631989 100644 --- a/compiler/codeGen/ClosureInfo.lhs +++ b/compiler/codeGen/ClosureInfo.lhs @@ -257,12 +257,12 @@ mkLFThunk thunk_ty top fvs upd_flag (might_be_a_function thunk_ty) might_be_a_function :: Type -> Bool +-- Return False only if we are *sure* it's a data type +-- Look through newtypes etc as much as poss might_be_a_function ty - | Just (tc,_) <- splitTyConApp_maybe (repType ty), - not (isFunTyCon tc) && not (isAbstractTyCon tc) = False - -- don't forget to check for abstract types, which might - -- be functions too. - | otherwise = True + = case splitTyConApp_maybe (repType ty) of + Just (tc, _) -> not (isDataTyCon tc) + Nothing -> True \end{code} @mkConLFInfo@ is similar, for constructors.