Skip to content

Fix functions as default values in records#2012

Merged
josevalim merged 1 commit intoelixir-lang:masterfrom
cabo:master
Jan 21, 2014
Merged

Fix functions as default values in records#2012
josevalim merged 1 commit intoelixir-lang:masterfrom
cabo:master

Conversation

@cabo
Copy link
Contributor

@cabo cabo commented Jan 20, 2014

successful check_value/2 needs to return its second argument

before:

iex(1)> defrecord Baz, foo: &Dict.get/1, bar: 4711
iex(2)> IO.puts inspect Baz[]
Baz[foo: nil, bar: 4711]
:ok
iex(3)>

after:

iex(4)> defrecord Baz, foo: &Dict.get/1, bar: 4711
iex(5)> IO.puts inspect Baz[]
Baz[foo: &Dict.get/1, bar: 4711]
:ok
iex(6)>

successful check_value/2 needs to return its second argument
@cabo
Copy link
Contributor Author

cabo commented Jan 20, 2014

(This of course also needs a test that fails now and succeeds after pulling. Left as an exercise for the merger, based on the example given above. Sorry about that.)

josevalim pushed a commit that referenced this pull request Jan 21, 2014
Fix functions as default values in records
@josevalim josevalim merged commit bfc165c into elixir-lang:master Jan 21, 2014
@josevalim
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants