diff options
author | Hans Bolinder <[email protected]> | 2017-03-06 15:40:38 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2017-03-06 15:40:38 +0100 |
commit | 40a25991acedfc2cf13f95208c02c41d59827807 (patch) | |
tree | 6cb9a4e2060cb6ad50d3cd010595414a9fd7d6eb /lib/dialyzer/src/dialyzer_dataflow.erl | |
parent | 58e9770a4ca2a1abf8ce4c5d1255e14e9c0ffba8 (diff) | |
parent | 6534f024ec21969fa054afd3f728b3e3d39f6142 (diff) | |
download | otp-40a25991acedfc2cf13f95208c02c41d59827807.tar.gz otp-40a25991acedfc2cf13f95208c02c41d59827807.tar.bz2 otp-40a25991acedfc2cf13f95208c02c41d59827807.zip |
Merge branch 'maint'
* maint:
dialyzer: Improve a warning
dialyzer: Fix a weird warning
dialyzer: Fix an opaque bug
dialyzer: Minor fix
Conflicts:
lib/dialyzer/src/dialyzer_dataflow.erl
Diffstat (limited to 'lib/dialyzer/src/dialyzer_dataflow.erl')
-rw-r--r-- | lib/dialyzer/src/dialyzer_dataflow.erl | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl index dc2238e63a..4c29b4f1eb 100644 --- a/lib/dialyzer/src/dialyzer_dataflow.erl +++ b/lib/dialyzer/src/dialyzer_dataflow.erl @@ -1344,8 +1344,6 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, State, Warns) -> {Msg, Force} = case t_is_none(ArgType0) of true -> - PatString = format_patterns(Pats), - PatTypes = [PatString, format_type(OrigArgType, State1)], %% See if this is covered by an earlier clause or if it %% simply cannot match OrigArgTypes = @@ -1353,14 +1351,24 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, State, Warns) -> true -> Any = t_any(), [Any || _ <- Pats]; false -> t_to_tlist(OrigArgType) end, + PatString = format_patterns(Pats), + ArgTypeString = format_type(OrigArgType, State1), + BindResOrig = + bind_pat_vars(Pats, OrigArgTypes, [], Map1, State1), Tag = - case bind_pat_vars(Pats, OrigArgTypes, [], Map1, State1) of + case BindResOrig of {error, bind, _, _, _} -> pattern_match; {error, record, _, _, _} -> record_match; {error, opaque, _, _, _} -> opaque_match; {_, _} -> pattern_match_cov end, - {{Tag, PatTypes}, false}; + PatTypes = case BindResOrig of + {error, opaque, _, _, OpaqueType} -> + [PatString, ArgTypeString, + format_type(OpaqueType, State1)]; + _ -> [PatString, ArgTypeString] + end, + {{Tag, PatTypes}, false}; false -> %% Try to find out if this is a default clause in a list %% comprehension and suppress this. A real Hack(tm) |