better error message when declaring a symbol with incompatible types