various changes, added isTypeDeclared method

in the SemanticVisitor