Phoenix: Dialyzer error for new Phoenix 1.4.15 apps in router.ex

Created on 12 Mar 2020  路  1Comment  路  Source: phoenixframework/phoenix

Environment

  • Elixir version (elixir -v): 1.9.2
  • Phoenix version (mix deps): 1.4.15
  • Operating system: Fedora 31

Expected behavior: To run without dialyzer errors.

Actual behavior:

1) Start a new phoenix application (using the 1.4.15 scaffolder) with

mix phx.new blib_blab --no-webpack

2) Install deps, mix deps.get
3) Install dialyxir in the v1 release candidate or 0.5.1 by adding to mix.exs under deps:

{:dialyxir, "~> 0.5.1", only: :dev, runtime: false}

or

{:dialyxir, "~> 1.0.0-rc.7", only: [:dev], runtime: false}

4) Run mix dialyzer, which gives the following error:

# Output from dialyxir 0.5.1
lib/blib_blab_web/router.ex:1: The pattern 
         <_@1,
          (_@2 = true)> can never match the type 
         <<<_:8>>,
          'false'>
# Output from dialyxir 1.0.0-rc7:
lib/blib_blab_web/router.ex:1:pattern_match
The pattern can never match the type.

Pattern:
_, _ = true

Type:
<<_::8>>, false

Most helpful comment

Fixed in v1.4 branch and will be in next release

>All comments

Fixed in v1.4 branch and will be in next release

Was this page helpful?
0 / 5 - 0 ratings