вопрос по dialyzer

85 views
Skip to first unread message

sleepwalker

unread,
Jul 9, 2013, 12:57:35 AM7/9/13
to


собственно
-module(test).
-compile(export_all).

test
() ->
 file
:open("/etc/resolv.conf", read).

dialyzer test.erl
Checking whether the PLT .dialyzer_plt is up-to-date... yes
 
Proceeding with analysis...
test
.erl:5: Function test/0 has no local return
test
.erl:6: The call file:open("/etc/resolv.conf",'read') breaks the contract (File,Modes) -> {'ok',IoDevice} | {'error',Reason} w
hen is_subtype
(File,Filename | iodata()), is_subtype(Filename,name_all()), is_subtype(Modes,[mode() | 'ram']), is_subtype(IoDevice
,io_device()), is_subtype(Reason,posix() | 'badarg' | 'system_limit')
 
done in 0m0.58s
done (warnings were emitted)

чего ему не нравится то?

Michael Uvarov

unread,
Jul 9, 2013, 1:07:04 AM7/9/13
to erlang-...@googlegroups.com
On 07/09/2013 08:55 AM, sleepwalker wrote:
file:open("/etc/resolv.conf", read).
Попробуйте file:open("/etc/resolv.conf", [read]).

sleepwalker

unread,
Jul 9, 2013, 1:30:20 AM7/9/13
to erlang-...@googlegroups.com
ну точно же! )
вторник, 9 июля 2013 г., 12:07:04 UTC+7 пользователь Michael Uvarov написал:
Reply all
Reply to author
Forward
0 new messages