Add test for remove type declaration
Implementation of remove type declaration