diff options
author | Björn Gustavsson <[email protected]> | 2014-02-03 12:24:34 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2014-02-05 09:59:34 +0100 |
commit | 89bbe43c61320d6415d2f530df54dc4f6ccf03d4 (patch) | |
tree | aa285e1e88e63bfafa8c05898c31db2c61c95bdc /lib/stdlib/src/array.erl | |
parent | 8ad4c1c9b3a13d0236a03d4f47fb3b847d8e5cee (diff) | |
download | otp-89bbe43c61320d6415d2f530df54dc4f6ccf03d4.tar.gz otp-89bbe43c61320d6415d2f530df54dc4f6ccf03d4.tar.bz2 otp-89bbe43c61320d6415d2f530df54dc4f6ccf03d4.zip |
dialyzer: Silence useless warnings about list comprehensions
Dialyzer will warn if the value of list comprehension is
ignored by putting it in a sequence like this:
[SomeSideEffect(E) || E <- Es],
ok
To avoid a warning, you'll have to write:
_ = [SomeSideEffect(E) || E <- Es],
ok
Most of the time, this warning is merely annoying because it does
not point out any real errors.
Kostis Sagonas suggested that by suppressing the warning for
list comprehension that return a list of a simple type (e.g. ['ok']),
there would be no warning for code such as:
[io:format("~p\n", [E]) || E <- Es],
ok
but there would be still be a warning for:
[file:close(Fd) || Fd <- Fds],
ok
because an error condition is ignored.
Diffstat (limited to 'lib/stdlib/src/array.erl')
0 files changed, 0 insertions, 0 deletions