Skip to content

Instantly share code, notes, and snippets.

@rylev
Created April 4, 2014 12:39
Show Gist options
  • Save rylev/9973892 to your computer and use it in GitHub Desktop.
Save rylev/9973892 to your computer and use it in GitHub Desktop.
defmodule User do
defstruct firstname: "Ryan", lastname: "Levick"
def full_name(user) do
user.firstname <> " " <> user.lastname
end
end
user = %User{}
User.full_name(user) =>
** (UndefinedFunctionError) undefined function: User.__struct__/0
User.__struct__()
(elixir) src/elixir_map.erl:55: :elixir_map.translate_struct/4
(elixir) src/elixir_translator.erl:17: :elixir_translator.translate/2
(elixir) src/elixir_translator.erl:351: :elixir_translator.translate_block/4
(elixir) src/elixir_translator.erl:39: :elixir_translator.translate/2
(elixir) src/elixir.erl:151: :elixir.quoted_to_erl/3
(elixir) src/elixir_lexical.erl:17: :elixir_lexical.run/2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment