Report errors for usage of private types when generating declaration file

Currently this change reports errors only for heritage clause and constraints of type parameters if the name is not public
question: If we could not find a symbol at this location, should we just break? what is the point of examining the parent if this link in the chain is not accessible?