Whenever I try to use Phoenix.Router.match/5 it trips dialyzer. I’m not sure if it’s me or Phoenix that has the problem. I’m also unable to figure out how to suppress the error using @dialyzer.
Router
defmodule MyProject.Router do
use Phoenix.Router
match :*, "/*path", MyProject.Controllers.CatchAll, :not_found
end
Dialyzer Error
lib/phoenix/router.ex:402:pattern_match
The pattern can never match the type.
Pattern:
:error
Type:
{%{
:conn => nil,
:log => :debug,
:path_params => map(),
:pipe_through => [],
:plug => MyProject.Controllers.CatchAll,
:plug_opts => :not_found,
:route => <<_::48>>
}, (map(), map() -> map()), (_ -> any()),
{MyProject.Controllers.CatchAll, :not_found}}
Yes, I dove into the Phoenix.Router source and found that as well. I’m assuming this is an issue with Phoenix. It probably makes sense for me to open an issue.