xpg

xpg

Deprecation warnings and warnings as errors

I generally enable warnings_as_errors in order to have the compiler fail hard in situations like invoking non-existing remote functions.
This worked well, until I started using @deprecated. As far as I see it, I now have to choose between the following two:

  1. Keep warnings as errors, and accept that @deprecated will cause compilation errors.
  2. Treat warnings as warnings, meaning that @deprecated will only be a warning. But so will invocations of non-existing functions.

Is there a middle-ground I am missing? Where I can have warnings for deprecations, but errors for invoking non-existing remote functions.

Marked As Solved

LostKobrakai

LostKobrakai

The middleground is soft deprecation using @doc deprecated: "…", but I’m not sure you’ll see those when compiling.

Last Post!

xpg

xpg

That will do it, thanks.

It would be nice to be able to differentiate between warnings (unused variables vs. invoking non-existing remote functions, for instance). But I guess that will open a can of worms and/or a substantial set of compiler options (which wouldn’t really make anyones life easier) :slight_smile:

Where Next?

Popular in Questions Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
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
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New

Other popular topics Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40165 209
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42716 114
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement