elixir - "dialyzer: Analysis failed with error.." (dialyzer bug? or wrong use of map-type?) -


working on simple application in progress of learning elixir, ran minor roadblock when checking types dialyzer. running dialyzer on code results in analysis failed error... far dialyzer has given me warnings , not errors when violate type spec's, have no clue error about.

trying narrow down problem, made ultra simple function performs offending return value.

  @spec blabla(integer) :: %{atom => any}   def blabla(1)     %{:error => 'wrong input (us-state)'}   end   def blabla(2)     %{ location: 'new york city, central park, ny', temp_c: '23.3',        visibility_mi: '10.00', weather: 'a few clouds', wind_dir: 'north',        wind_kt: '0' }   end 

when running dialyzer on following error

  proceeding analysis... =error report==== 14-jul-2015::17:26:55 === error in process <0.31.0> exit value: {function_clause,[{erl_types,t_form_to_string,[{type,12,map_field_assoc,{type,12,atom,[]},{type,12,any,[]}}],[{file,"erl_types.erl"},{line,4546}]},{erl_types,t_form_to_string_list,2,[{file,"erl_types.erl"},{line,4637}]},{erl_types,t_form_to_string...    dialyzer: analysis failed error: {function_clause,[{erl_types,t_form_to_string,                              [{type,12,map_field_assoc,                                     {type,12,atom,[]},                                     {type,12,any,[]}}],                              [{file,"erl_types.erl"},{line,4546}]},                   {erl_types,t_form_to_string_list,2,                              [{file,"erl_types.erl"},{line,4637}]},                   {erl_types,t_form_to_string,1,                              [{file,"erl_types.erl"},{line,4634}]},                   {erl_types,t_form_to_string,1,                              [{file,"erl_types.erl"},{line,4590}]},                   {dialyzer_contracts,contract_to_string_1,1,                                       [{file,"dialyzer_contracts.erl"},                                        {line,107}]},                   {dialyzer_contracts,extra_contract_warning,6,                                       [{file,"dialyzer_contracts.erl"},                                        {line,712}]},                   {dialyzer_contracts,picky_contract_check,7,                                       [{file,"dialyzer_contracts.erl"},                                        {line,686}]},                   {dialyzer_contracts,get_invalid_contract_warnings_funs,5,                                       [{file,"dialyzer_contracts.erl"},                                        {line,654}]}]} 

am defining map-type in wrong way? or bug in dialyzer?

there nothing wrong code or typespec. looks dialyzer bug, can try updating latest version of erlang.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -