Created
May 18, 2015 00:55
-
-
Save bjhaid/dbe99726476f5b2e2249 to your computer and use it in GitHub Desktop.
Compilation errors with bitstring spec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(test). | |
-compile([export_all]). | |
-spec foo(<<_:32, _:_*8>>) -> list. | |
foo(<<X:32, Y/binary>>) -> [X, Y]. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Test do | |
@spec foo(<<_ :: 32, _ :: _ * 8>>) :: list | |
def foo(<<x :: 32, y :: binary>>), do: [x, y] | |
end | |
""" | |
$ elixirc test.exs | |
== Compilation error on file test.exs == | |
** (CompileError) test.exs:2: type '*'(_,_) undefined | |
(stdlib) lists.erl:1336: :lists.foreach/2 | |
(stdlib) erl_eval.erl:657: :erl_eval.do_apply/6 | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment