<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hello -<div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class=""><div class="">-module(ex1).</div><div class=""><br class=""></div><div class="">-export([callback_mode/0]).</div><div class="">-export([handle_event/4]).</div><div class="">-export([init/1]).</div><div class="">-export([start/0]).</div><div class=""><br class=""></div><div class="">start() -></div><div class=""> gen_statem:start({local, ?MODULE}, ?MODULE, [], []).</div><div class=""><br class=""></div><div class="">init([]) -></div><div class=""> {ok,</div><div class=""> initial_state,</div><div class=""> initial_data,</div><div class=""> {next_event, internal, initial_event}}.</div><div class=""><br class=""></div><div class="">callback_mode() -></div><div class=""> handle_event_function.</div><div class=""><br class=""></div><div class="">handle_event(Type, Event, State, Data) -></div><div class=""> error_logger:info_report([{type, Type},</div><div class=""> {event, Event},</div><div class=""> {state, State},</div><div class=""> {data, Data}]),</div><div class=""> keep_state_and_data.</div><div class=""><br class=""></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">brew switch erlang 20.2.4</div><div class=""><br class=""></div><div class="">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 class=""><br class="">Eshell V9.2.1 (abort with ^G)<br class="">1> ex1:start().<br class="">{ok,<0.62.0>}<br class=""><br class="">=INFO REPORT==== 15-Mar-2018::12:13:29 ===<br class=""> type: internal<br class=""> event: initial_event<br class=""> state: initial_state<br class=""> data: initial_data<br class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">brew switch erlang 20.3</div><div class="">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 class=""><br class="">Eshell V9.3 (abort with ^G)<br class="">1> c(ex1).<br class="">{ok,ex1}<br class="">2> ex1:start().<br class="">{ok,<0.67.0>}<br class="">3> <br class="">=ERROR REPORT==== 15-Mar-2018::12:15:02 ===<br class="">** State machine ex1 terminating<br class="">** Last event = {internal,init_state}<br class="">** When server state = {initial_state,initial_data}<br class="">** Reason for termination = error:{bad_action_from_state_function,<br class=""> {next_events,internal,initial_event}}<br class="">** Callback mode = handle_event_function<br class="">** Stacktrace =<br class="">** [{gen_statem,parse_actions_next_event,7,<br class=""> [{file,"gen_statem.erl"},{line,1299}]},<br class=""> {gen_statem,loop_event_actions_list,10,<br class=""> [{file,"gen_statem.erl"},{line,1194}]},<br class=""> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]<br class=""><br class=""></div><div class=""><br class=""></div><div class="">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" class="">http://erlang.org/doc/man/gen_statem.html#type-init_result</a>.</div><div class=""><br class=""></div><div class="">Thanks</div><div class="">Peter.</div><div class=""><br class=""></div></body></html>