Another bug in Erlang code

Richard Carlsson <>
Fri Mar 18 11:02:01 CET 2005


Kostis Sagonas wrote:
>   Another QUIZ inspired by bugs identified by the new type inference.
> 
> Who can spot the error in the following xmerl/src/xmerl.erl code?
>
> export_simple_content(Data, Callback) when atom(Callback) ->
>     export_content(xmerl_lib:expand_content(Data),
>                    callbacks(Callback));
> export_simple_content(Data, Callbacks) when list(Callbacks) ->
>     export_content(xmerl_lib:expand_element(Data), Callbacks).

Mea culpa. I guess nobody's ever called export_simple_content with
a list of callbacks, or this would have shown up. Just a copy/paste
error; cf. the function export_simple_element/2, some lines below.
Thanks for finding it. :-)

	/R



More information about the erlang-questions mailing list