Skip to content

Instantly share code, notes, and snippets.



Created Apr 1, 2015
What would you like to do?
Erlang not good with strings
%% -*- coding: utf-8 -*-
%% wat_clauses:
%% a warning should be emitted as 2nd clause will never match (given 1st clause)
%% API
authenticate_nouns([{<<"user_auth">>, _}]) -> 'true';
authenticate_nouns([{<<"user_auth">>, [<<"recovery">>]}]) -> hi;
authenticate_nouns(_Nouns) -> 'false'.
%% End of Module.

This comment has been minimized.

Copy link

@jamesaimonetti jamesaimonetti commented Apr 1, 2015

Probably not the intended order!


This comment has been minimized.

Copy link
Owner Author

@fenollp fenollp commented Apr 1, 2015

Yes, wat_clauses:authenticate_nouns([{<<"user_auth">>, [<<"recovery">>]}]) is true instead of hi.

The thing is warnings need to be emitted, either by erlc or dialyzer, and none do.

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