diff options
author | Björn Gustavsson <[email protected]> | 2010-06-07 09:02:31 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-06-07 09:02:31 +0000 |
commit | 707c6510597e5eb6e32b88412edd717e0e3c39ba (patch) | |
tree | d7d121471c5b0689fad422fc47d46b7deba943c8 /lib/dialyzer/src | |
parent | 5e354ca66996ee03d615dc36c284e94ccf176e89 (diff) | |
download | otp-707c6510597e5eb6e32b88412edd717e0e3c39ba.tar.gz otp-707c6510597e5eb6e32b88412edd717e0e3c39ba.tar.bz2 otp-707c6510597e5eb6e32b88412edd717e0e3c39ba.zip |
Fix confusing dialyzer warnings for is_record/2 with illegal records
In commit 1858cb81391d2bce29b4b7620574ca60128cebf7, erl_expand_records
started to optimize is_record/2 in guards by replacing it with
pattern matching (if possible).
Unfortunately, dialyzer will no longer see the code before the
optimization, so any warnings produced in code such as:
case ExprNotProducingRecord#rec{} of
X when is_record(X, rec, N) -> ...
will refer to the optimized code and not the source code,
which is confusing for the user.
Introduce the no_is_record_optimization option for turning off
the optimization and use it in dialyzer.
Reported-by: Kostis Sagonas
Diffstat (limited to 'lib/dialyzer/src')
-rw-r--r-- | lib/dialyzer/src/dialyzer_utils.erl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/dialyzer/src/dialyzer_utils.erl b/lib/dialyzer/src/dialyzer_utils.erl index f5bfc6ad2f..338027c5ab 100644 --- a/lib/dialyzer/src/dialyzer_utils.erl +++ b/lib/dialyzer/src/dialyzer_utils.erl @@ -380,7 +380,8 @@ sets_filter([Mod|Mods], ExpTypes) -> src_compiler_opts() -> [no_copt, to_core, binary, return_errors, - no_inline, strict_record_tests, strict_record_updates]. + no_inline, strict_record_tests, strict_record_updates, + no_is_record_optimization]. -spec get_module(abstract_code()) -> module(). |