You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I try to call Id.new("random value") i get following error:
** (FunctionClauseError) no function clause matching in anonymous fn/2 in Kernel.struct/2
The following arguments were given to anonymous fn/2 in Kernel.struct/2:
# 1
:id
# 2
%Id{id: nil}
(elixir) lib/kernel.ex:1975: anonymous fn/2 in Kernel.struct/2
(elixir) lib/enum.ex:1925: Enum."-reduce/3-lists^foldl/2-0-"/3
Ah, I misunderstood, thanks @OvermindDL1! I assumed the shorthand syntax (the syntax without a do block, which this person is using) didn't have any fields, but that's not the case (it has one field).
So yeah, that looks like a bug.
Will look into this more soon.
Thanks for the report @revati !
Following the example in docs, I created a module
when I try to call
Id.new("random value")
i get following error:Environment:
The text was updated successfully, but these errors were encountered: