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: what if we were looking for a static method on a class, the parent is not a module in this case.. how would that wok?