Added semantic analysis for type declarations.