<div dir="ltr">Crash log mentions 'next_events' (rather than 'next_event'.) Perhaps you have a typo somewhere? But if that's the case, then it's weird that 20.2.x doesn't complaint about it as well.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 15 March 2018 at 11:23, Peter Morgan <span dir="ltr"><<a href="mailto:peter.james.morgan@gmail.com" target="_blank">peter.james.morgan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">Hello -<div><br></div><div>I am sure I am doing something daft. I picked up 20.3 this morning and have some gen_statem code that previously worked in 20.2.4:</div><div><br></div><div><div>-module(ex1).</div><div><br></div><div>-export([callback_mode/0]).</div><div>-export([handle_event/4]).</div><div>-export([init/1]).</div><div>-export([start/0]).</div><div><br></div><div>start() -></div><div>    gen_statem:start({local, ?MODULE}, ?MODULE, [], []).</div><div><br></div><div>init([]) -></div><div>    {ok,</div><div>     initial_state,</div><div>     initial_data,</div><div>     {next_event, internal, initial_event}}.</div><div><br></div><div>callback_mode() -></div><div>    handle_event_function.</div><div><br></div><div>handle_event(Type, Event, State, Data) -></div><div>    error_logger:info_report([{<wbr>type, Type},</div><div>                              {event, Event},</div><div>                              {state, State},</div><div>                              {data, Data}]),</div><div>    keep_state_and_data.</div><div><br></div></div><div><br></div><div><br></div><div><br></div><div>brew switch erlang 20.2.4</div><div><br></div><div>Erlang/OTP 20 [erts-9.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]<br><br>Eshell V9.2.1  (abort with ^G)<br>1> ex1:start().<br>{ok,<0.62.0>}<br><br>=INFO REPORT==== 15-Mar-2018::12:13:29 ===<br>    type: internal<br>    event: initial_event<br>    state: initial_state<br>    data: initial_data<br><br></div><div><br></div><div><br></div><div>brew switch erlang 20.3</div><div>Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]<br><br>Eshell V9.3  (abort with ^G)<br>1> c(ex1).<br>{ok,ex1}<br>2> ex1:start().<br>{ok,<0.67.0>}<br>3> <br>=ERROR REPORT==== 15-Mar-2018::12:15:02 ===<br>** State machine ex1 terminating<br>** Last event = {internal,init_state}<br>** When server state  = {initial_state,initial_data}<br>** Reason for termination = error:{bad_action_from_state_<wbr>function,<br>                                      {next_events,internal,<wbr>initial_event}}<br>** Callback mode = handle_event_function<br>** Stacktrace =<br>**  [{gen_statem,parse_<wbr>actions_next_event,7,<br>                 [{file,"gen_statem.erl"},{<wbr>line,1299}]},<br>     {gen_statem,loop_event_<wbr>actions_list,10,<br>                 [{file,"gen_statem.erl"},{<wbr>line,1194}]},<br>     {proc_lib,init_p_do_apply,3,[<wbr>{file,"proc_lib.erl"},{line,<wbr>247}]}]<br><br></div><div><br></div><div>The docs seem to indicate that next_event remains valid on init/1 - <a href="http://erlang.org/doc/man/gen_statem.html#type-init_result" target="_blank">http://erlang.org/doc/man/<wbr>gen_statem.html#type-init_<wbr>result</a>.</div><div><br></div><div>Thanks</div><span class="HOEnZb"><font color="#888888"><div>Peter.</div><div><br></div></font></span></div><br>______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Guilherme<br></div></div></div></div></div></div>
</div>