Oban.Pro.Decorator fails to compile with opts \\ []

I’m trying to use a new Oban.Pro.Decorators, but it fails to compile when I use opts \\ [].
Is this a limitation or a bug?

defmodule MyApp.Business do
  use Oban.Pro.Decorator

  @job true
  def weekly_report(tps_id, opts \\ []) do
    {:ok, "report"}
  end
end
    error: def new_weekly_report/3 defaults conflicts with new_weekly_report/2
    │
  1 │ defmodule MyApp.Business do
    │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^

I’m using Oban.Pro 1.5.0-rc.3

That’s a limitation (for now) because of the compile time gymnastics required to generate all of the decorated clauses. Eventually we’ll handle defaults, but for now you need to pass the empty options list through at the call site.

1 Like