[erlang-questions] erl_syntax and bitstrings ?

Richard Carlsson <>
Fri Feb 24 22:42:43 CET 2017


This is a bug. The code was not updated when bitstrings were added, and
crashes when it tries to run binary_to_list(Bin) on the given binary.
Thanks for reporting it!


        /Richard

2017-02-24 7:03 GMT+01:00 Yoshihiro Tanaka <>:

> Hi, I encountered following case where erl_syntax:abstract/1 returns
> exception when given a bitstring:
>
> 4> erl_syntax:abstract(<<0:1>>).
>> ** exception error: bad argument: <<0:1>>
>>      in function  erl_syntax:abstract/1 (erl_syntax.erl, line 5951)
>
>
> Is this expected ? The document says:
>
>> Term must be a literal term, i.e., one that can be represented as a
>> source code literal.
>
>
> I guess <<0:1>> can be put in a source code.
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170224/a1fe45e8/attachment.html>


More information about the erlang-questions mailing list