wabbit icon indicating copy to clipboard operation
wabbit copied to clipboard

Broken match in Wabbit.GenStage.noreply_callback

Open h4cc opened this issue 7 years ago • 0 comments

There is a bug in this function: https://github.com/pma/wabbit/blob/master/lib/wabbit/gen_stage.ex#L271

There is not "module" key in state: https://github.com/pma/wabbit/blob/master/lib/wabbit/gen_stage.ex#L6

Fix could look like this:

  defp noreply_callback(callback, args, %__MODULE__{mod: module} = state) do
    handle_noreply_callback apply(module, callback, args), state
  end

Hint: Using %__MODULE__{} for matches will let the compiler validate keys.

h4cc avatar Mar 14 '18 07:03 h4cc