fix(rule_func): refine `+` error info when type implicit conversion
This commit is contained in:
parent
d8a022fb45
commit
0a5a0867e4
|
@ -338,7 +338,13 @@ null() ->
|
|||
|
||||
%% concat 2 strings
|
||||
'+'(X, Y) when is_binary(X), is_binary(Y) ->
|
||||
concat(X, Y).
|
||||
concat(X, Y);
|
||||
|
||||
%% unsupported type implicit conversion
|
||||
'+'(X, Y)
|
||||
when (is_number(X) andalso is_binary(Y)) orelse
|
||||
(is_binary(X) andalso is_number(Y)) ->
|
||||
error(unsupported_type_implicit_conversion).
|
||||
|
||||
'-'(X, Y) when is_number(X), is_number(Y) ->
|
||||
X - Y.
|
||||
|
|
Loading…
Reference in New Issue