Re: 17.0 : dialyzer issue on boolean type in record.
PAILLEAU Eric <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.bugs |
|---|---|
| Message-ID | <[email protected]> |
Hi Steve,
dialyzer is right, yes, in a sens, because the default value is not
dynamically set, but what about below code ?
dialyzer raise an error, because too smart, probably,
while code is valid...
This indeed imply to only set the type and not default value...
Regards.
---8<----------------------------------------------------
-module(test).
-export([test/0]).
-ifdef(TEST).
-record(test, { bool = 'true' :: boolean()} ).
-else.
-record(test, { bool = 'false' :: boolean()} ).
-endif.
test() -> test(#test{}).
test(R) -> case R#test.bool of
true -> true ;
false -> false
end.
---8<----------------------------------------------------
_______________________________________________
erlang-bugs mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-bugs