Support optional parameters in defdelegate #4196

Closed
stavro opened this Issue Jan 13, 2016 · 3 comments

Projects

None yet

3 participants

@stavro
stavro commented Jan 13, 2016

For consistency with function declarations, it would be nice to consider supporting optional parameters in defdelegate.

Example:

defmodule Foo do
  def foo(options \\ []) do
    IO.puts "Foo!"
  end
end

What is currently required:

defmodule Bar do
  defdelegate foo(), to: Foo
  defdelegate foo(options), to: Foo
end

What should be allowed:

defmodule Bar do
  defdelegate foo(options \\ []), to: Foo
end
@josevalim
Member

👍 we did some changes to make this possible from now on.

@tuvistavie
Contributor

I would like to give this one a try!

@josevalim
Member

Please go ahead!

José Valimwww.plataformatec.com.br
http://www.plataformatec.com.br/Founder and Director of R&D

@tuvistavie tuvistavie added a commit to tuvistavie/elixir that referenced this issue Jan 14, 2016
@tuvistavie tuvistavie Add defdelegate optional parameters. Close #4196. 4fc1a6c
@tuvistavie tuvistavie added a commit to tuvistavie/elixir that referenced this issue Jan 14, 2016
@tuvistavie tuvistavie Add defdelegate optional parameters. Close #4196. 5d6dfba
@tuvistavie tuvistavie added a commit to tuvistavie/elixir that referenced this issue Jan 14, 2016
@tuvistavie tuvistavie Add defdelegate optional parameters. Close #4196. 3892318
@tuvistavie tuvistavie added a commit to tuvistavie/elixir that referenced this issue Jan 14, 2016
@tuvistavie tuvistavie Add defdelegate optional parameters. Close #4196. b6dcc85
@josevalim josevalim closed this in 30ae003 Jan 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment