(#19001) Allow autorequire to work with classes