+checkValidTyCl this_mod decl
+ = tcLookup (tcdName decl) `thenNF_Tc` \ (AGlobal thing) ->
+ if not (isLocalThing this_mod thing) then
+ -- Don't bother to check validity for non-local things
+ returnTc ()
+ else
+ tcAddDeclCtxt decl $
+ case thing of
+ ATyCon tc -> checkValidTyCon tc
+ AClass cl -> checkValidClass cl