Compiler: Improved type checking for program references.

Inherits and type declarations now complain about use of
deprecated symbols.