Report error if the entityname reference in the import declaration is us...

Report error if the entityname reference in the import declaration is using private module
why do we need to sort the declarations?