Sounds like an absolute nightmare of a problem to solve. And a maintenance nightmare.
Languages change over time.
Languages change over time.
For a related idea, see Facebook's Haskell system, in which only type-safe code is allowed to be checked into the respository:
https://code.facebook.com/posts/745068642270222/fighting-spa...