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.
Lost track of this one, sorry. The ambiguity of multiple arguments with defaults makes this difficult to implement, and even trickier to understand. That’s because the decorated function also has an optional clause.
Take the following example:
@job true
def foo(opts \\ []) do
...
end
If that worked, you’d have new_foo/0, new_foo/1, and new_foo/2 where new_foo/1 would ambiguously take either the optional args for foo, or options for new, with no way for the decorator (or you as a developer) to differentiate.
The best option may be to detect that the decorated function has optional args and provide a clearer error that explains the problem clearly