You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Passing connect_timeout as an option to ssh_sftp:start_channel/2 gives the following dialyzer warning:
src/mylib_app.erl
Line 12 Column 1: Function start/2 has no local return
Line 14 Column 5: The contract ssh_sftp:start_channel(ssh:open_socket(),[ssh:client_option() | sftp_option()]) -> {'ok',pid(),ssh:connection_ref()} | {'error',reason()}
; (ssh:connection_ref(),[sftp_option()]) -> {'ok',pid()} | {'ok',pid(),ssh:connection_ref()} | {'error',reason()}
; (ssh:host(),[ssh:client_option() | sftp_option()]) -> {'ok',pid(),ssh:connection_ref()} | {'error',reason()} cannot be right because the inferred return for start_channel(Pid::pid(),[{'connect_timeout', 1000}]) on line {14,5} is any()
To Reproduce
Analyse with dialyzer the following code (make sure to include the ssh application, I used a rebar3 app where I changed the app.src file)
I could not determine exactly what is the type of TimeOut and I could not figure out if that can actually happen, but could it be that TimeOut doesn't comply with the spec? It's hard to see the connection with connect_timeout so maybe it's not interesting but I thought of mentioning it.
Affected versions
Erlang/OTP 27.2 and master (tested with commit 53ffb6a)
Additional context
If instead of passing connect_timeout, timeout is used, then no warning is detected by dialyzer. So if the following code is analysed instead no warning occurs:
Describe the bug
Passing
connect_timeout
as an option to ssh_sftp:start_channel/2 gives the following dialyzer warning:To Reproduce
Analyse with dialyzer the following code (make sure to include the ssh application, I used a rebar3 app where I changed the app.src file)
Expected behavior
No dialyzer warning should be shown. That being said, if you look at the implementation you can see that
TimeOut
can be returned:I could not determine exactly what is the type of TimeOut and I could not figure out if that can actually happen, but could it be that TimeOut doesn't comply with the spec? It's hard to see the connection with
connect_timeout
so maybe it's not interesting but I thought of mentioning it.Affected versions
Erlang/OTP 27.2 and master (tested with commit 53ffb6a)
Additional context
If instead of passing
connect_timeout
,timeout
is used, then no warning is detected by dialyzer. So if the following code is analysed instead no warning occurs:and also
The text was updated successfully, but these errors were encountered: