Implement static safety with TH.