Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/elixir/src/elixir_bitstring.erl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ concat_or_prepend_bitstring(Meta, {'<<>>', PartsMeta, Parts} = ELeft, ERight, Ac
[{'::', Meta, [ELeft, ERight]} | Acc]
end;
{bitstring, _, nil} ->
lists:reverse(Parts, Acc)
lists:reverse(Parts, Acc);
_ ->
[{'::', Meta, [ELeft, ERight]} | Acc]
end;
concat_or_prepend_bitstring(Meta, ELeft, ERight, Acc, _E, _RequireSize) ->
[{'::', Meta, [ELeft, ERight]} | Acc].
Expand Down
6 changes: 6 additions & 0 deletions lib/elixir/test/elixir/kernel/binary_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ defmodule Kernel.BinaryTest do
assert_compile_error(message, fn ->
Code.eval_string(~s[<<"foo"::float>>])
end)

assert_compile_error(message, fn ->
# We need to wrap the example below in a module because
# we attempt to continue compilation when inside a function
Code.compile_string("defmodule Repro do\n def run, do: <<(<<1>>)::integer>>\nend")
end)
end

@bitstring <<"foo", 16::4>>
Expand Down
Loading