Hello,

It would be very useful if module attributes could be used when defining 
binary values via << ... >>, like in this example

defmodule MyModule do
  @param 8
  @bin << 0 :: @param >>
end

which fails to compile

== Compilation error in file lib/..../file.ex ==
** (CompileError) lib/..../file.ex:6: unknown bitstring specifier: Module.
__get_attribute__(__MODULE__, :param, 6)
    (elixir) src/elixir_bitstring.erl:171: :elixir_bitstring.expand_specs/6
    (elixir) src/elixir_bitstring.erl:41: :elixir_bitstring.expand/8
    (elixir) src/elixir_bitstring.erl:20: :elixir_bitstring.expand/4
    (stdlib) lists.erl:1354: :lists.mapfoldl/3
    (stdlib) lists.erl:1355: :lists.mapfoldl/3
    (elixir) expanding macro: Kernel.@/1

Thanks
Mário Guimarães

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/8c879262-bb6e-4be7-a60c-83b7d89e78fd%40googlegroups.com.

Reply via email to