07 Aug 2014, 14:27
Generic-user-small

Bill Christian (4 posts)

I copied the code straight from the code link example for Chapter 8 defstruct1 and I am getting the following error:

ds135-37-55-88:Elixir billc$ iex defstruct1.exs
Erlang/OTP 17 [erts-6.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Interactive Elixir (0.15.0) - press Ctrl+C to exit (type h() ENTER for help)

iex(1)> a1 = %Attendee{ name: "Bill" }
** (CompileError) iex:1: Attendee.__struct__/0 is undefined, cannot expand   struct Attendee
(elixir) src/elixir_map.erl:44: :elixir_map.translate_struct/4
(elixir) src/elixir_translator.erl:17: :elixir_translator.translate/2
iex(1)>

The previous Subscriber example worked with no issue. I removed the additional methods from Attendee, but still reports error. Is there a clash with Attendee?

  You must be logged in to comment