Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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