pinterest / elixometer

A light Elixir wrapper around exometer.

Home Page:https://hexdocs.pm/elixometer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dialyzer reports "Function has no local return"

building39 opened this issue · comments

For any function in my application, if I make a call to, say, update_counter or clear_counter, dialyzer will report that my application's function has no local return. Removing the call to update_counter or clear_counter causes the dialyzer warning to go away. Why is this?

Ahh, the famous no local return error.
I'm guessing (and I'm only guessing here, investigation will require a significant amount of work) the reason is that Elixometer doesn't have typespecs, and dialyzer can't correctly perform success typing on these function calls. It's also likely that in some instances, a call to these functions can exit or throw, and not return data.

In practice though, they're pretty safe, as Pinterest and several other companies have been using Elixometer in production for years. I can't remember a single Elixometer related failure during my tenure.

I just added some initial typesepcs in #107.

🎉

@building39 I'm going to close this, assuming your problem is fixed. If not, feel free to reopen.