Handle inheritance and trait compatibility with tests