diff options
author | Hans Bolinder <[email protected]> | 2014-05-13 08:31:19 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2014-06-17 12:32:51 +0200 |
commit | 8498a35ce141c6e16feed198540b910b9475b2e2 (patch) | |
tree | 1f460c322886ce3f949fedfc753c59bd5973d5c2 /lib/dialyzer/test/small_SUITE_data/src/confusing_record_warning.erl | |
parent | e2961080386045f3e4ef59d9895b680ccdc4fbe4 (diff) | |
download | otp-8498a35ce141c6e16feed198540b910b9475b2e2.tar.gz otp-8498a35ce141c6e16feed198540b910b9475b2e2.tar.bz2 otp-8498a35ce141c6e16feed198540b910b9475b2e2.zip |
[dialyzer] Fix handling of literal records
This ticket is about records in Erlang code, and when to check the
fields against the (optional) types given when defining records.
Dialyzer operates on the Erlang Core format, where there are no trace
of records. The fix implemented is a Real Hack:
Given the new option 'dialyzer' erl_expand_records marks the line
number of records in a way that is undone by v3_core, which in turn
inserts annotations that can be recognized by Dialyzer.
Diffstat (limited to 'lib/dialyzer/test/small_SUITE_data/src/confusing_record_warning.erl')
-rw-r--r-- | lib/dialyzer/test/small_SUITE_data/src/confusing_record_warning.erl | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/src/confusing_record_warning.erl b/lib/dialyzer/test/small_SUITE_data/src/confusing_record_warning.erl deleted file mode 100644 index 8af74e0914..0000000000 --- a/lib/dialyzer/test/small_SUITE_data/src/confusing_record_warning.erl +++ /dev/null @@ -1,19 +0,0 @@ -%%--------------------------------------------------------------------- -%% A user complained that dialyzer produces a weird warning for the -%% following program. I explained to him that there is an implicit -%% assumption that when a record is typed one cannot have types of -%% the same size which are tagged by the record name whose elements -%% have different types than the ones declared in the record. -%% -%% But the warning from dialyzer was weird nonetheless: -%% The pattern {'r', [_]} can never match the type any() -%% We should clearly give some less confusing warning in this case. -%%--------------------------------------------------------------------- --module(confusing_record_warning). - --export([test/1]). - --record(r, {field :: binary}). - -test({r, [_]}) -> - #r{field = <<42>>}. |