From 1f9f1f5f841853310889d3668141b807b744ece2 Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Thu, 1 Mar 2012 10:59:34 +0100 Subject: Fix bug in remote type solving --- .../test/behaviour_SUITE_data/src/custom_sup.erl | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lib/dialyzer/test/behaviour_SUITE_data/src/custom_sup.erl (limited to 'lib/dialyzer/test/behaviour_SUITE_data/src') diff --git a/lib/dialyzer/test/behaviour_SUITE_data/src/custom_sup.erl b/lib/dialyzer/test/behaviour_SUITE_data/src/custom_sup.erl new file mode 100644 index 0000000000..8ec84d798f --- /dev/null +++ b/lib/dialyzer/test/behaviour_SUITE_data/src/custom_sup.erl @@ -0,0 +1,37 @@ +%%% Dialyzer was giving a warning with this input because of a bug in the +%%% substitution of remote types in specs. Remote types in the first element of +%%% a tuple would not update the tuple's tag set and we could end up with a +%%% non-normalized representation. +%%% +%%% Reported by Damian DobroczyƄski on 29/02/2012 + +-module(custom_sup). + +-behavior(supervisor). + +-export([init/1]). + +-spec init(atom()) -> + {ok, {{supervisor:strategy(), non_neg_integer(), non_neg_integer()}, + [supervisor:child_spec()]}} | ignore. + +init(StorageName) -> + Strategy = {one_for_all, 100, 1}, + %% get application-wide storage parameters + case application:get_env(storage) of + undefined -> + ignore; + {ok, Storage} -> + BackendId = proplists:get_value(backend, Storage), + BackendArgs = proplists:get_value(args, Storage), + if + (BackendId =:= undefined) orelse (BackendArgs =:= undefined) -> + ignore; + true -> + {ok, {Strategy, + [{id1, {a_module, start_link, []}, + permanent, 5000, worker, [a_module]}, + {id2, {another_module, start_link, []}, + permanent, 5000, worker, [another_module]}]}} + end + end. -- cgit v1.2.3