Run check for unused fields only when compilation succeeded