Hi,
In the Typespecs docs, there is a reference to the literal %{…} as shorthand for any map. I have not been able to get this to compile though. This is the error I get:
== Compilation error on file web/models/user.ex ==
** (FunctionClauseError) no function clause matching in anonymous fn/1 in Macro.map_list_to_string/2
(elixir) lib/macro.ex:904: anonymous fn({:..., [line: 15], nil}) in Macro.map_list_to_string/2
(elixir) lib/enum.ex:1215: anonymous fn/4 in Enum.map_join/3
(elixir) lib/enum.ex:1623: Enum."-reduce/3-lists^foldl/2-0-"/3
(elixir) lib/enum.ex:1214: Enum.map_join/3
(elixir) lib/macro.ex:609: Macro.to_string/2
(elixir) lib/kernel/typespec.ex:773: anonymous fn/5 in Kernel.Typespec.typespec/3
(stdlib) lists.erl:1239: :lists.map/2
(elixir) lib/kernel/typespec.ex:752: Kernel.Typespec.typespec/3
(elixir) lib/kernel/typespec.ex:390: Kernel.Typespec.translate_type/3
(stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
(elixir) lib/kernel/parallel_compiler.ex:116: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1
In user.ex, line 15:
@type params :: %{...}
I’m running Elixir 1.3.2.
Am I misreading the usage for this literal?
Thanks