I’ve encountered an odd error where Dialyzer appears to be failing on clauses generated by
Plug.Builder that shouldn’t ever cause errors because they’re marked as generated.
This issue appeared when we recently upgraded from
plug 1.10.1 to 1.10.3, but I don’t see any changes between those two that look suspicious.
Example project: https://github.com/al2o3cr/dialyzer_example
I believe the offending clause is here in
Plug.Builder, because commenting out that one and running Dialyzer makes the error go away (the app would naturally not WORK in that state )
In my production code, the function plug that triggers this is very simple:
def FooController do use FooWeb, :controller plug(:set_up_context) ... def set_up_context(conn, _params) do set_stuff_up_in_sentry(conn) # doesn't modify conn, always returns conn end end
I wasn’t able to recreate the exact behavior in the demo app, but I was able to produce the same warning by explicitly setting
halted: false in the plug.
- Erlang 22.2.4
- Elixir 1.10.0-otp-22
- Dialyxir 1.0.0
- Phoenix 1.4.17
- Plug 1.10.3