-checkValidInstance :: [TyVar] -> ThetaType -> Class -> [TcType] -> TcM ()
-checkValidInstance tyvars theta clas inst_tys
- = do { undecidable_ok <- doptM Opt_UndecidableInstances
+checkValidInstance :: LHsType Name -> [TyVar] -> ThetaType -> Type
+ -> TcM (Class, [TcType])
+checkValidInstance hs_type tyvars theta tau
+ = setSrcSpan (getLoc hs_type) $
+ do { (clas, inst_tys) <- setSrcSpan head_loc $
+ checkValidInstHead tau
+
+ ; undecidable_ok <- doptM Opt_UndecidableInstances