diff options
-rw-r--r-- | lib/dialyzer/test/small_SUITE_data/results/record_creation_diffs | 3 | ||||
-rw-r--r-- | lib/dialyzer/test/small_SUITE_data/src/record_creation_diffs.erl | 11 | ||||
-rw-r--r-- | lib/hipe/cerl/erl_types.erl | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/results/record_creation_diffs b/lib/dialyzer/test/small_SUITE_data/results/record_creation_diffs new file mode 100644 index 0000000000..f00c4b10ff --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/results/record_creation_diffs @@ -0,0 +1,3 @@ + +record_creation_diffs.erl:10: Function foo/1 has no local return +record_creation_diffs.erl:11: Record construction #bar{some_list::{'this','is','a','tuple'}} violates the declared type of field some_list::'undefined' | [any()] diff --git a/lib/dialyzer/test/small_SUITE_data/src/record_creation_diffs.erl b/lib/dialyzer/test/small_SUITE_data/src/record_creation_diffs.erl new file mode 100644 index 0000000000..e813459f8e --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/src/record_creation_diffs.erl @@ -0,0 +1,11 @@ +-module(record_creation_diffs). + +-export([foo/1]). + +-record(bar, { + some_atom :: atom(), + some_list :: list() + }). + +foo(Input) -> + #bar{some_atom = Input, some_list = {this,is,a,tuple}}. diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index bc7ea17077..f5be8fb08f 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -3432,7 +3432,7 @@ record_field_diffs_to_string(?tuple([_|Fs], Arity, Tag), RecDict) -> field_diffs([F|Fs], [{FName, DefType}|FDefs], RecDict, Acc) -> NewAcc = - case t_is_subtype(F, DefType) of + case not t_is_none(t_inf(F, DefType)) of true -> Acc; false -> Str = atom_to_string(FName) ++ "::" ++ t_to_string(DefType, RecDict), |