Report error from target file

Fix issue #779
do you need to check the whole program? we only need to check targetSourceFile