add checker for function redefine
add type declaration