Fix Trac #4841: behave right with TypeSynonymInstances and NoFlexibleInstances
[ghc-hetmet.git] / compiler / typecheck / TcType.lhs
index 89aba65..50ac35a 100644 (file)
@@ -956,6 +956,9 @@ tcInstHeadTyAppAllTyVars :: Type -> Bool
 -- Used in Haskell-98 mode, for the argument types of an instance head
 -- These must be a constructor applied to type variable arguments
 tcInstHeadTyAppAllTyVars ty
+  | Just ty' <- tcView ty       -- Look through synonyms
+  = tcInstHeadTyAppAllTyVars ty'
+  | otherwise
   = case ty of
        TyConApp _ tys  -> ok tys
        FunTy arg res   -> ok [arg, res]