Skip to content

elli_ws_protocol#state.env now type list().#6

Open
pulltab wants to merge 1 commit intommzeeman:masterfrom
pulltab:master
Open

elli_ws_protocol#state.env now type list().#6
pulltab wants to merge 1 commit intommzeeman:masterfrom
pulltab:master

Conversation

@pulltab
Copy link

@pulltab pulltab commented Jul 15, 2016

elli_ws_protocol#state.env was typed as an empty list, which resulted in dialyzer generating the following error when users tried passing in valid options to elli_websocket:upgrade/2:

The call elli_websocket:upgrade(Req::any(), WsArgs::[{'handler','***'} | {'handler_opts',[]} | {'resp_compress','false'},...]) will never return since it differs in the 2nd argument from the success typing arguments: (#req{method::'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'POST' | 'PUT' | 'TRACE' | 'undefined' | binary(),path::'undefined' | [binary()],args::'undefined' | [{binary(),_}],raw_path::'undefined' | binary(),version::'undefined' | {0 | 1,0 | 1 | 9},headers::'undefined' | [{binary(),binary() | [any()]}],body::'undefined' | binary() | maybe_improper_list(binary() | maybe_improper_list(any(),binary() | []) | byte(),binary() | []),pid::'undefined' | pid(),socket::'undefined' | {'plain',port()} | {'ssl',_},callback::'undefined' | {atom() | tuple(),_}}, [])

To correct this, the type of elli_ws_protocol#state.env must be list().

@Vagabond
Copy link

Please consider merging this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants