diff options
author | Stavros Aronis <[email protected]> | 2011-09-27 13:07:47 +0200 |
---|---|---|
committer | Stavros Aronis <[email protected]> | 2011-09-27 13:07:47 +0200 |
commit | e36b171c318ba8c475fe0727fe2d0d35f86a4a73 (patch) | |
tree | 1770952544f5b640f44e4d0c4c5736440c3b5f2a /lib/dialyzer | |
parent | 53cf0b70c705e0bf6c09f83f2ce2709d79593ce6 (diff) | |
download | otp-e36b171c318ba8c475fe0727fe2d0d35f86a4a73.tar.gz otp-e36b171c318ba8c475fe0727fe2d0d35f86a4a73.tar.bz2 otp-e36b171c318ba8c475fe0727fe2d0d35f86a4a73.zip |
Fix bug in dataflow
Diffstat (limited to 'lib/dialyzer')
-rw-r--r-- | lib/dialyzer/src/dialyzer_dataflow.erl | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl index 659297f993..d74c04385b 100644 --- a/lib/dialyzer/src/dialyzer_dataflow.erl +++ b/lib/dialyzer/src/dialyzer_dataflow.erl @@ -1399,10 +1399,14 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, true -> Any = t_any(), [Any || _ <- Pats]; false -> t_to_tlist(OrigArgType) end, - case bind_pat_vars(Pats, OrigArgTypes, [], Map1, State1) of - {error, bind, _, _, _} -> {{pattern_match, PatTypes}, false}; - {_, _} -> {{pattern_match_cov, PatTypes}, false} - end; + Tag = + case bind_pat_vars(Pats, OrigArgTypes, [], Map1, State1) of + {error, bind, _, _, _} -> pattern_match; + {error, record, _, _, _} -> record_match; + {error, opaque, _, _, _} -> opaque_match; + {_, _} -> pattern_match_cov + end, + {{Tag, PatTypes}, false}; false -> %% Try to find out if this is a default clause in a list %% comprehension and supress this. A real Hack(tm) @@ -1442,12 +1446,12 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, opaque -> [PatString, format_type(Type, State1), format_type(OpaqueTerm, State1)] end, - FailedMsg = case ErrorType of - bind -> {pattern_match, PatTypes}; - record -> {record_match, PatTypes}; - opaque -> {opaque_match, PatTypes} + FailedTag = case ErrorType of + bind -> pattern_match; + record -> record_match; + opaque -> opaque_match end, - {FailedMsg, Force0} + {{FailedTag, PatTypes}, Force0} end, WarnType = case Msg of {opaque_match, _} -> ?WARN_OPAQUE; |