diff options
author | Kostis Sagonas <[email protected]> | 2010-09-24 15:57:13 +0300 |
---|---|---|
committer | Kostis Sagonas <[email protected]> | 2010-09-24 15:57:13 +0300 |
commit | 3fbe522acb52ae4123e0068d352b8aa4ab767ece (patch) | |
tree | a8d81757ddab39cb3a11d16b91c512bbd710951b /lib/dialyzer/src/dialyzer_utils.erl | |
parent | dd51118499209bbd91c0092d9778897026bde4c6 (diff) | |
download | otp-3fbe522acb52ae4123e0068d352b8aa4ab767ece.tar.gz otp-3fbe522acb52ae4123e0068d352b8aa4ab767ece.tar.bz2 otp-3fbe522acb52ae4123e0068d352b8aa4ab767ece.zip |
Fix two errors in dialyzer
Changes which fix some problems reported by dialyzer users:
1. The handling of nested opaque types
2. The handling of remote types in record expressions used as types
While at it, updated dialyzer's RELEASE_NOTES to reflect these fixes
and did some cleanups to dialyzer_utils.erl so that it gets in sync
with dialyzer's main development branch.
Diffstat (limited to 'lib/dialyzer/src/dialyzer_utils.erl')
-rw-r--r-- | lib/dialyzer/src/dialyzer_utils.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/dialyzer/src/dialyzer_utils.erl b/lib/dialyzer/src/dialyzer_utils.erl index a9da229061..248fdf6835 100644 --- a/lib/dialyzer/src/dialyzer_utils.erl +++ b/lib/dialyzer/src/dialyzer_utils.erl @@ -66,7 +66,7 @@ print_types1([{opaque, _Name} = Key|T], RecDict) -> io:format("\n~w: ~w\n", [Key, erl_types:t_from_form(Form, RecDict)]), print_types1(T, RecDict); print_types1([{record, _Name} = Key|T], RecDict) -> - {ok, [{Arity, Fields} = AF]} = dict:find(Key, RecDict), + {ok, [{_Arity, _Fields} = AF]} = dict:find(Key, RecDict), io:format("~w: ~w\n\n", [Key, AF]), print_types1(T, RecDict). -define(debug(D_), print_types(D_)). @@ -211,9 +211,9 @@ get_record_and_type_info([_Other|Left], Module, Records, RecDict) -> get_record_and_type_info([], _Module, Records, RecDict) -> case type_record_fields(lists:reverse(Records), RecDict) of {ok, _NewRecDict} = Ok -> - ?debug(NewRecDict), + ?debug(_NewRecDict), Ok; - {Name, {error, Error}} -> + {error, Name, Error} -> {error, lists:flatten(io_lib:format(" Error while parsing #~w{}: ~s\n", [Name, Error]))} end. @@ -269,9 +269,9 @@ type_record_fields([RecKey|Recs], RecDict) -> RecDict2 = dict:update(RecKey, Fun, RecDict1), type_record_fields(Recs, RecDict2) catch - throw:{error, _} = Error -> + throw:{error, Error} -> {record, Name} = RecKey, - {Name, Error} + {error, Name, Error} end. -spec process_record_remote_types(dialyzer_codeserver:codeserver()) -> dialyzer_codeserver:codeserver(). @@ -378,7 +378,7 @@ sets_filter([Mod|Mods], ExpTypes) -> -spec src_compiler_opts() -> [compile:option(),...]. src_compiler_opts() -> - [no_copt, to_core, binary, return_errors, + [no_copt, to_core, binary, return_errors, no_inline, strict_record_tests, strict_record_updates, no_is_record_optimization]. |