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
I'm getting to be a bigger fan of placing these functions at the bottom (kind of like with the `where` clause in Haskell), since it kind of obscures the actual functionality of the function.