This stems from compat_arith_type returning TInteger in the general case:
compat_arith_type(Ty1, Ty2, Env) ->
TInteger = type(integer)
...
even if one of Ty1 or Ty2 are more specific and the operator is +.
Test:
test() ->
Indent = string:length("123"),
lists:duplicate(Indent + 3, " ").
Found when typechecking OTP's argparse.erl.
This stems from
compat_arith_typereturningTIntegerin the general case:even if one of
Ty1orTy2are more specific and the operator is+.Test:
Found when typechecking OTP's
argparse.erl.