marcandre

marcandre

Will Phoenix 1.16 require unique route helpers?

Trying phoenix 1.16-rc.0, I get a bunch of warnings in our router. I believe this is because many different routes have the same helper name. In phoenix 1.15 this was not issuing warnings. Is this a bug or a feature?

I’ll note that the warnings are not as clear as they could be:

warning: this clause for admin_account_path/3 cannot match because a previous clause at line 0 always matches
  lib/bobby_web/router.ex

warning: this clause for admin_account_url/3 cannot match because a previous clause at line 0 always matches
  lib/bobby_web/router.ex

warning: this clause for admin_beneficiary_path/3 cannot match because a previous clause at line 0 always matches
  lib/bobby_web/router.ex

warning: this clause for admin_beneficiary_url/3 cannot match because a previous clause at line 0 always matches
  lib/bobby_web/router.ex
[...]

Marked As Solved

josevalim

josevalim

Creator of Elixir

No! We have always allowed those and we have a heuristic to handle conflicts by compiling all clauses in a certain order. However, as the Elixir compiler gets smarter, we can now see those conflicts and warn. The fix is to change Phoenix to not emit those duplications, something I just pushed to master and v1.5 branches.

I just need to understand why the line information is 0. It should be at least the module line.

Also Liked

josevalim

josevalim

Creator of Elixir

It has been addressed. :slight_smile:

Where Next?

Popular in Questions Top

tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New

Other popular topics Top

hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31307 143
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement