Skip to content

import Phoenix.VerifiedRoutes does not raise error #6550

@leifertin

Description

@leifertin

Environment

  • Elixir version (elixir -v): 1.19.0
  • Phoenix version (mix deps): 1.8.2
  • Operating system: Mac 15.7.2

Actual behavior

Using import Phoenix.VerifiedRoutes when building a test case/helper raises no warning or error. When you have any ~p routes in a test, they will cause a compiler error warning:

** (BadMapError) expected a map, got:

[]

(phoenix 1.8.2) lib/phoenix/verified_routes.ex:943: Phoenix.VerifiedRoutes.rewrite_path/4
(phoenix 1.8.2) lib/phoenix/verified_routes.ex:915: Phoenix.VerifiedRoutes.build_route/5
(phoenix 1.8.2) expanding macro: Phoenix.VerifiedRoutes.sigil_p/2

Expected behavior

The compiler should let you know the error is import/use not a BadMapError.

Discussion here: VerifiedRoutes don’t build after phoenix update to 1.8.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions