Erlang 我该如何解决一个问题;将永远不会返回,因为成功键入为[…],合同为“…”;从透析器?

Erlang 我该如何解决一个问题;将永远不会返回,因为成功键入为[…],合同为“…”;从透析器?,erlang,dialyzer,Erlang,Dialyzer,我正在使用透析器修复Erlang代码中的错误 io:format(IoDevice, "[]"); 此行产生以下错误: The call io:format(IoDevice::pid(),[91 | 93,...]) will never return since the success typing is (atom() | binary() | string(),[any()]) -> 'ok' and the contract is (Form

我正在使用透析器修复Erlang代码中的错误

io:format(IoDevice, "[]");
此行产生以下错误:

The call io:format(IoDevice::pid(),[91 | 93,...]) 
  will never return since the success typing is
  (atom() | binary() | string(),[any()]) -> 'ok' 
  and the contract is (Format,Data) -> 'ok' 
  when Format :: format(), Data :: [term()]
我不明白问题是什么,有人能解释一下吗

谢谢你

我推荐你阅读。它的用法很简单:

1> io:format("hello ~p~n", [world]). % ~n means newline
hello world
ok
2> io:format("hello ~p~n", [<<"world">>]).             
hello <<"world">>
ok
3> io:format("hello ~s~n", [<<"world">>]).
hello world
ok
1>io:format(“hello~p~n,[world])。%~n表示换行
你好,世界
好啊
2> io:format(“hello~p~n”,[])。
你好
好啊
3> io:format(“hello~s~n”,[])。
你好,世界
好啊
在上面的例子中,透析器告诉您,
io:format/2
format/2
表示接受两个参数的函数
format
)接受一个
atom()
string()
binary()
作为第一个参数,接受一个包含零个或多个元素的列表作为第二个参数。根据您的代码,透析器检测到
IoDevice
是Erlang
pid()
而不是
string()
binary()