[autoloader] Check class definition before declaration