Merge "Add sanity checking to declaring class visiting"