~rdoering/ubuntu/lucid/erlang/fix-535090

« back to all changes in this revision

Viewing changes to lib/dialyzer/src/dialyzer_succ_typings.erl

  • Committer: Elliot Murphy
  • Date: 2009-12-22 02:56:21 UTC
  • mfrom: (3.3.5 sid)
  • Revision ID: elliot@elliotmurphy.com-20091222025621-qv3rja8gbpiabkbe
* Merge with Debian testing; remaining Ubuntu changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to. (LP #438365)
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
* Fixed dialyzer(1) manpage which was placed into section 3 and conflicted
  with dialyzer(3erl).
* New upstream release (it adds a new binary package erlang-erl-docgen).
* Refreshed patches, removed most of emacs.patch which is applied upstream.
* Linked run_test binary from erlang-common-test package to /usr/bin.
* Fixed VCS headers in debian/control.
* Moved from prebuilt manpages to generated from sources. This adds
  erlang-manpages binary package and xsltproc build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
308
308
  MFAs = [MFA || {MFA, {_Var, _Fun}, _Rec} <- SCC_Info],
309
309
  NextLabel = dialyzer_codeserver:get_next_core_label(Codeserver),
310
310
  Plt1 = dialyzer_plt:delete_contract_list(Plt, MFAs),
311
 
  FunTypes = dialyzer_typesig:analyze_scc_get_all_fun_types(SCC_Info, NextLabel, 
312
 
                                                            Callgraph, Plt1, 
313
 
                                                            PropTypes),
 
311
  FunTypes = dialyzer_typesig:analyze_scc(SCC_Info, NextLabel, 
 
312
                                          Callgraph, Plt1, PropTypes),
314
313
  AllFunSet = sets:from_list([X || {X, _} <- AllFuns]),
315
314
  FilteredFunTypes = dict:filter(fun(X, _) ->
316
315
                                      sets:is_element(X, AllFunSet) 
434
433
  {ok, Code} = dialyzer_utils:get_core_from_abstract_code(AbstrCode),
435
434
  {ok, Records} = dialyzer_utils:get_record_and_type_info(AbstrCode),
436
435
  %% contract typing info in dictionary format
437
 
  {ok, Contracts} = dialyzer_utils:get_spec_info(AbstrCode, Records),
 
436
  {ok, Contracts} =
 
437
    dialyzer_utils:get_spec_info(cerl:concrete(cerl:module_name(Code)),
 
438
                                 AbstrCode, Records),
438
439
  Sigs0 = get_top_level_signatures(Code, Records, Contracts),
439
440
  M = if is_atom(Module) ->  
440
441
          list_to_atom(filename:basename(atom_to_list(Module)));
447
448
  pp_signatures(Sigs, Records),
448
449
  ok.
449
450
 
450
 
-spec get_top_level_signatures(core_records(), dict(), dict()) ->
 
451
-spec get_top_level_signatures(cerl:c_module(), dict(), dict()) ->
451
452
         [{{atom(), arity()}, erl_types:erl_type()}].
452
453
 
453
454
get_top_level_signatures(Code, Records, Contracts) ->
486
487
pp_signatures([{{M, F, _A}, Type}|Left], Records) ->
487
488
  TypeString =
488
489
    case cerl:is_literal(Type) of
489
 
      true -> io_lib:format("~w", [cerl:concrete(Type)]);
490
 
      false -> "fun(" ++ String = erl_types:t_to_string(Type, Records),
491
 
               string:substr(String, 1, length(String)-1)
 
490
%% Commented out so that dialyzer does not complain
 
491
%%      false -> 
 
492
%%        "fun(" ++ String = erl_types:t_to_string(Type, Records),
 
493
%%        string:substr(String, 1, length(String)-1);
 
494
      true ->
 
495
        io_lib:format("~w", [cerl:concrete(Type)])
492
496
    end,
493
497
  io:format("~w:~w~s\n", [M, F, TypeString]),
494
498
  pp_signatures(Left, Records);