[erlang-bugs] binary:compile_pattern/1 spec doesn't match binary:cp() opaque definition

Lukas Larsson lukas@REDACTED
Mon May 7 09:39:47 CEST 2012


Hi,

I just confirmed that this has been fixed in the master branch which 
will be released in the next major release.

Lukas

On 04/05/12 17:47, Hynek Vychodil wrote:
> On Fri, May 4, 2012 at 3:30 PM, Lukas Larsson<lukas@REDACTED>  wrote:
>> Hi,
>>
>> Which version of Erlang are you running?
>>
>> The specs of BIFs in the master branch on github (which will be part of the
>> R16 release) have been completely rewritten so the issue might be fixed
>> there.
>>
>> Lukas
> Erlang R15B01 (erts-5.9.1)
>
>>
>> On 04/05/12 14:09, Hynek Vychodil wrote:
>>> Hello,
>>>
>>> binary:compile_pattern/1 spec makes dialyzer unhappy. This minimal
>>> module shows it.
>>>
>>> -module(binary_compile_dialyzer_issue).
>>>
>>> -export([test/0]).
>>>
>>> test() ->
>>>    binary:split(<<>>, binary:compile_pattern(<<>>), []).
>>>
>>> Dialyzer output is
>>>
>>> $ dialyzer -q binary_compile_dialyzer_issue.erl
>>>
>>> binary_compile_dialyzer_issue.erl:5: Function test/0 has no local return
>>> binary_compile_dialyzer_issue.erl:6: The call
>>> binary:split(#{}#,{'ac',binary()} | {'bm',binary()},[]) does not have
>>> a term of type binary() | [binary()] | binary:cp() (with opaque
>>> subterms) as 2nd argument
>>>
>>> If I understand it right
>>>
>>> /usr/lib/erlang/lib/hipe-3.9.1/cerl/erl_bif_types.erl:4672
>>> t_binary_compiled_pattern() ->
>>>    t_tuple([t_sup(t_atom('bm'), t_atom('ac')), t_binary()]).
>>>
>>> should return opaque type. Unfortunately I seems not skilled enough to
>>> provide patch.
>>>
>>> Best regards
>>>
>> _______________________________________________
>> erlang-bugs mailing list
>> erlang-bugs@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-bugs
>
>



More information about the erlang-bugs mailing list