checking type compatibility for function parameters and return types