Don't skip validity checks for built-in classes (#17355)