erlang / otp

Erlang/OTP
http://erlang.org
Apache License 2.0
11.15k stars 2.92k forks source link

Bad match in shell completion #8626

Open williamthome opened 2 days ago

williamthome commented 2 days ago

Describe the bug When starting an expression in the shell with begin and pressing the TAB key in a tuple after =, the shell crashes.

To Reproduce By running erl and typing in the shell

begin {ok, Foo} = { % TAB

It crashes with the following error

*** ERROR: Shell process terminated! ***
=ERROR REPORT==== 28-Jun-2024::13:00:39.449474 ===
Error in process <0.71.0> with exit value:
{{badmatch,[]},
 [{edlin_context,over_map_record_or_tuple,1,
                 [{file,"edlin_context.erl"},{line,391}]},
  {edlin_context,over_to_opening1,2,[{file,"edlin_context.erl"},{line,339}]},
  {edlin_context,over_to_opening,1,[{file,"edlin_context.erl"},{line,328}]},
  {edlin_context,get_context,2,[{file,"edlin_context.erl"},{line,248}]},
  {edlin_expand,expand,3,[{file,"edlin_expand.erl"},{line,165}]},
  {group,get_line1,5,[{file,"group.erl"},{line,734}]},
  {group,get_chars_loop,10,[{file,"group.erl"},{line,518}]},
  {group,io_request,6,[{file,"group.erl"},{line,213}]}]}

erlang_otp_shell_bug

Expected behavior No errors.

Affected versions I've tested only in OTP-27.