Improve failed type checking message for var declarations